Fork me on GitHub

Changeset 264 in svn for trunk


Ignore:
Timestamp:
Feb 11, 2009, 10:22:30 AM (16 years ago)
Author:
Xavier Rouby
Message:

first test 2.0

Location:
trunk
Files:
4 added
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r260 r264  
    3131
    3232/// \file Delphes.cpp
    33 /// \brief executable for the Delphes
     33/// \brief Executable for Delphes
    3434
    3535#include "TChain.h"
     
    4141#include "ExRootTreeWriter.h"
    4242#include "ExRootTreeBranch.h"
     43#include "ExRootProgressBar.h"
    4344
    4445#include "DataConverter.h"
     
    4849
    4950#include "SmearUtil.h"
     51#include "CaloUtil.h"
    5052#include "BFieldProp.h"
    5153#include "TriggerUtil.h"
     
    5658#include <vector>
    5759#include <iostream>
    58 
    59 #include "Utilities/ExRootAnalysis/interface/ExRootProgressBar.h"
    6060
    6161using namespace std;
     
    7777int main(int argc, char *argv[])
    7878{
     79unsigned int nnnn=0, mmmm=0;
     80
    7981  int appargc = 2;
    8082  char *appName= new char[20];
     
    8688  delete [] appName;
    8789  delete [] appOpt;
    88 
    8990
    9091  if(argc != 3 && argc != 4 && argc != 5) {
     
    242243  //Propagation of tracks in the B field
    243244  TrackPropagation *TRACP = new TrackPropagation(DET);
    244   //TrackPropagation *TRACP = new TrackPropagation(DetDatacard);
    245245 
    246246  //Jet information
    247247  JetsUtil *JETRUN = new JetsUtil(DET);
    248   //JetsUtil *JETRUN = new JetsUtil(DetDatacard);
    249248 
    250249  //VFD information
    251250  VeryForward * VFD = new VeryForward(DET);
    252   //VeryForward * VFD = new VeryForward(DetDatacard);
    253251 
    254252  // data converters
     
    299297  ExRootTreeBranch *branchMuon = treeWriter->NewBranch("Muon", TRootMuon::Class());
    300298  ExRootTreeBranch *branchPhoton = treeWriter->NewBranch("Photon", TRootPhoton::Class());
    301   ExRootTreeBranch *branchTracks = treeWriter->NewBranch("Tracks", TRootTracks::Class());
     299  //ExRootTreeBranch *branchTracks = treeWriter->NewBranch("Tracks", TRootTracks::Class());
     300  ExRootTreeBranch *branchTrack = treeWriter->NewBranch("Tracks", D_Track::Class());
    302301  ExRootTreeBranch *branchETmis = treeWriter->NewBranch("ETmis", TRootETmis::Class());
    303302  ExRootTreeBranch *branchCalo = treeWriter->NewBranch("CaloTower", TRootCalo::Class());
     
    306305  ExRootTreeBranch *branchFP420 = treeWriter->NewBranch("FP420hits", TRootRomanPotHits::Class());
    307306 
    308   TRootGenParticle *particle;
    309307  TRootETmis *elementEtmis;
    310308  TRootElectron *elementElec;
    311309  TRootMuon *elementMu;
    312310  TRootPhoton *elementPhoton;
    313   TRootTracks *elementTracks;
     311  D_Track * elementTrack;
    314312  TRootCalo *elementCalo;
    315313 
     
    323321  vector<TLorentzVector> TrackCentral; 
    324322  vector<PhysicsTower> towers;
    325   vector<ParticleUtil> electron;
    326   vector<ParticleUtil> muon;
    327   vector<ParticleUtil> gamma;
     323  //vector<ParticleUtil> electron;
     324  vector<D_Particle> electron;
     325  //vector<ParticleUtil> muon;
     326  vector<D_Particle> muon;
     327  //vector<ParticleUtil> gamma;
     328  vector<D_Particle> gamma;
    328329
    329330  TSimpleArray<TRootGenParticle> NFCentralQ;
    330   float iPhi=0,iEta=0;
    331 
     331
     332D_CaloList list_of_calorimeters;
     333D_CaloElement CentralCalo("centralcalo",
     334        -DET->CEN_max_calo_cen, DET->CEN_max_calo_cen,
     335         DET->ELG_Ccen,  DET->ELG_Ncen,  DET->ELG_Scen,
     336         DET->HAD_Chcal, DET->HAD_Nhcal, DET->HAD_Shcal);
     337D_CaloElement ForwardCalo("forwardcalo",
     338         DET->CEN_max_calo_cen, DET->CEN_max_calo_fwd,
     339         DET->ELG_Cfwd,  DET->ELG_Nfwd,  DET->ELG_Sfwd,
     340         DET->HAD_Chf,   DET->HAD_Nhf,   DET->HAD_Shf  );
     341D_CaloElement BackwardCalo("backwardcalo",
     342        -DET->CEN_max_calo_fwd, -DET->CEN_max_calo_cen,
     343         DET->ELG_Cfwd,  DET->ELG_Nfwd,  DET->ELG_Sfwd,
     344         DET->HAD_Chf,   DET->HAD_Nhf,   DET->HAD_Shf  );
     345//D_CaloElement CastorCalo("castor",5.5,6.6,1,0,0,1,0,0);
     346list_of_calorimeters.addElement(CentralCalo);
     347list_of_calorimeters.addElement(ForwardCalo);
     348list_of_calorimeters.addElement(BackwardCalo);
     349//list_of_calorimeters.addElement(CastorCalo);
     350list_of_calorimeters.sortElements();
    332351
    333352
     
    360379      towers.clear();
    361380      input_particles.clear();
    362      
     381
     382
     383/*
     384if(0) { // OLD SMEARING ALGORITHM without energy flow
    363385      // 2.1 Loop over all particles in event
    364386      itGen.Reset();
    365387      while( (particle = (TRootGenParticle*) itGen.Next()) ) {
    366388          int pid = abs(particle->PID);
     389          float iPhi=0,iEta=0;
    367390
    368391       
     
    381404          // the ordering of conditions have been optimised for speed : put first the STATUS condition
    382405          if( (particle->Status == 1)    &&
    383               ((pid != pNU1) && (pid != pNU2) && (pid != pNU3)) &&
     406              (pid != pNU1) && (pid != pNU2) && (pid != pNU3) &&
    384407              (fabs(particle->Eta) < DET->CEN_max_calo_fwd)
    385408              )
     
    431454              if(genMomentumBfield.E() !=0 && pid != pMU) {
    432455                // in case the Bfield is not simulated, checks that charged particles have enough pt to reach the calos
    433                 if ( !DET->FLAG_bfield && charge!=0 && genMomentumBfield.Pt() <= DET->TRACK_ptmin ) { /* particules do not reach calos */ }
     456                if ( !DET->FLAG_bfield && charge!=0 && genMomentumBfield.Pt() <= DET->TRACK_ptmin ) {}// particules do not reach calos
    434457                else { // particles reach calos
    435458                  // applies the calo segmentation and returns iEta & iPhi
    436459                  DET->BinEtaPhi(genMomentumBfield.Phi(), genMomentumBfield.Eta(), iPhi, iEta);
    437                   if(iEta != -100 && iPhi != -100) {
     460                  if(iEta != UNDEFINED && iPhi != UNDEFINED) {
    438461                      momentumCaloSegmentation.SetPtEtaPhiE(genMomentumBfield.Pt(),iEta,iPhi,genMomentumBfield.E());
    439462                      elementCalo = (TRootCalo*) branchCalo->NewEntry();
     
    441464                      PhysicsTower Tower(LorentzVector(momentumCaloSegmentation.Px(),momentumCaloSegmentation.Py(),momentumCaloSegmentation.Pz(),momentumCaloSegmentation.E()));
    442465                      towers.push_back(Tower);
    443                   } // if iEta != -100
     466                  } // if iEta != UNDEFINED
    444467                } // else : when particles reach the calos
    445468              } // 2.1.2.3 calotowers
    446              
     469
    447470
    448471              // 2.1.2.4 ********************* central detector: tracks
     
    451474                 (genMomentumBfield.E()!=0) &&
    452475                 (fabs(genMomentumBfield.Eta()) < DET->CEN_max_tracker) &&
    453                  (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentumBfield.Pt() > DET->TRACK_ptmin )) &&     
     476                 (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentum.Pt() > DET->TRACK_ptmin )) &&     
    454477                        // if bfield not simulated, pt should be high enough to be taken into account
    455478                 ((rand()%100) < DET->TRACK_eff)  &&
     
    475498             VFD->RomanPots(treeWriter,branchRP220,branchFP420,particle);
    476499          }
    477          
    478        } // 2.1 while : loop on all particles of the event.
    479      
     500} // IF OLD ALGORITHM (= no energy flow )
     501
     502
     503
     504
     505else // IF NEW ALGORITHM with energy flow             
     506*/
     507{
     508      D_CaloTowerList list_of_active_towers;
     509      D_CaloTowerList list_of_towers_with_photon; // to speed up the code: will only look in interesting towers for gamma candidates
     510
     511      // 2.1a Loop over all particles in event, to fill the towers
     512      itGen.Reset();
     513      TRootGenParticle *particle;
     514      while( (particle = (TRootGenParticle*) itGen.Next()) ) {
     515          int pid = abs(particle->PID);
     516          particle->Charge=Charge(pid);
     517          particle->setFractions(); // init
     518
     519
     520          // 2.1a.1********************* preparation for the b-tagging
     521          //// This subarray is needed for the B-jet algorithm
     522          // optimization for speed : put first PID condition, then ETA condition, then either pt or status
     523          if( (pid <= pB || pid == pGLUON) &&// is it a light quark or a gluon, i.e. is it one of these : u,d,c,s,b,g ?
     524              fabs(particle->Eta) < DET->CEN_max_tracker &&
     525              particle->Status != 1 &&
     526              particle->PT > DET->PT_QUARKS_MIN ) {
     527            NFCentralQ.Add(particle);
     528          }
     529
     530          // 2.1a.2********************* visible particles only
     531          if( (particle->Status == 1) && (pid != pNU1) && (pid != pNU2) && (pid != pNU3) ){
     532
     533            // 2.1a.2.1 Central solenoidal magnetic field
     534            TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo
     535            particle->SetEtaPhi(particle->EtaCalo,particle->PhiCalo); // ???? check this line
     536
     537            // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ?
     538            // first checks if the charged particles reach the calo!
     539            if( DET->FLAG_bfield ||
     540                particle->getCharge()==0 ||
     541                (!DET->FLAG_bfield && particle->getCharge()!=0 && particle->PT > DET->TRACK_ptmin))
     542            if(
     543                (particle->EtaCalo > list_of_calorimeters.getEtamin() ) &&
     544                (particle->EtaCalo < list_of_calorimeters.getEtamax() )
     545              ) {
     546                float iEta=UNDEFINED, iPhi=UNDEFINED;
     547                DET->BinEtaPhi(particle->PhiCalo,particle->EtaCalo,iPhi,iEta); // fills in iPhi and iEta
     548                if (iEta != UNDEFINED && iPhi != UNDEFINED)
     549                {
     550                  D_CaloTower tower(iEta,iPhi);                                // new tower
     551                  tower.Set_Eem_Ehad_E_ET(particle->E*particle->getFem() , particle->E*particle->getFhad() );
     552               
     553                  list_of_active_towers.addTower(tower);
     554                  // this list may contain several times the same calotower, as several particles
     555                  // may leave some energy in the same calotower
     556                  // After the loop on particles, identical cells in the list should be merged
     557                } // iEta and iPhi must be defined
     558            }
     559
     560            // 2.1a.2.3 charged particles in tracker: energy flow
     561            // if bfield not simulated, pt should be high enough to be taken into account
     562            // it is supposed here that DET->MAX_calo > DET->CEN_max_tracker > DET->CEN_max_mu > 0
     563            if( particle->getCharge() !=0 &&
     564                fabs(particle->EtaCalo)< DET->CEN_max_tracker && // stays in the tracker -> track available
     565               ( DET->FLAG_bfield ||
     566                  (!DET->FLAG_bfield && particle->PT > DET->TRACK_ptmin)
     567                )
     568              ) {       
     569                // 2.1a.2.3.1 Filling the particle properties + smearing
     570                   // Hypothesis: the final eta/phi are the ones from the generator, thanks to the track reconstruction
     571                   // This is the EnergyFlow hypothesis
     572                   particle->SetEtaPhi(particle->Eta,particle->Phi);
     573                   float sET=UNDEFINED; // smeared ET, computed from the smeared E -> needed for the tracks
     574
     575                   // 2.1a.2.3.2 Muons
     576                   if (pid == pMU && fabs(particle->EtaCalo)< DET->CEN_max_mu && particle->PT > DET->PTCUT_muon ) {
     577                        TLorentzVector p;
     578                        float sPT = gRandom->Gaus(particle->PT, DET->MU_SmearPt*particle->PT );
     579                        if (sPT > 0 && sPT > DET->PTCUT_muon) {
     580                           p.SetPtEtaPhiE(sPT,particle->Eta,particle->Phi,sPT*cosh(particle->Eta));
     581                           muon.push_back(D_Particle(p,pMU,particle->EtaCalo,particle->PhiCalo));
     582                        }
     583                        sET = (sPT >0)? sPT : 0;
     584                   } 
     585                   // 2.1a.2.3.3 Electrons
     586                   else if (pid == pE) {
     587                     // Finds in which calorimeter the particle has gone, to know its resolution
     588
     589                     D_CaloElement currentCalo = list_of_calorimeters.getElement(particle->EtaCalo);
     590                     if(currentCalo.getName() == dummyCalo.getName()) {
     591                        cout << "** Warning: the calo coverage behind the tracker is not complete! **" << endl; }
     592
     593                     // final smeared EM energy   // electromagnetic fraction F_em =1 for electrons;
     594                     float sE  = currentCalo.getElectromagneticResolution().Smear(particle->E);
     595                     if (sE>0) {
     596                       sET = sE/cosh(particle->Eta);
     597                       // NB: ET is found via the calorimetry and not via the track curvature
     598
     599                       TLorentzVector p;
     600                       p.SetPtEtaPhiE(sET,particle->Eta,particle->Phi,sE);
     601                       if (sET > DET->PTCUT_elec)
     602                         electron.push_back(D_Particle(p,particle->PID,particle->EtaCalo,particle->PhiCalo));
     603                     } else { sET=0;} // if negative smeared energy -- needed for the tracks
     604                   } 
     605                   // 2.1a.2.3.4 Other charged particles : smear them for the tracks!
     606                   else {  //other particles
     607                        D_CaloElement currentCalo = list_of_calorimeters.getElement(particle->EtaCalo);
     608                        float sEem  = currentCalo.getElectromagneticResolution().Smear(particle->E * particle->getFem());
     609                        float sEhad = currentCalo.getHadronicResolution().Smear(particle->E * particle->getFhad());
     610                        float sE = ( (sEem>0)? sEem : 0 ) + ( (sEhad>0)? sEhad : 0 );
     611                        sET = sE/cosh(particle->EtaCalo);
     612                   }
     613
     614                   // 2.1a.2.3.5 Tracks
     615                   if( (rand()%100) < DET->TRACK_eff && sET!=0) {
     616                     elementTrack = (D_Track*) branchTrack->NewEntry();
     617                     elementTrack->Set(particle->Eta, particle->Phi, particle->EtaCalo, particle->PhiCalo, sET);
     618                     TrackCentral.push_back(elementTrack->GetFourVector()); // tracks at vertex!
     619                     // TODO!!! associates the tracks to the calo where it points to
     620                     // TODO!!! apply a smearing on the position of the origin of the track
     621                     // TODO!!! elementTracks->SetPositionOut(Xout,Yout,Zout);
     622                   }
     623            } // 2.1a.2.3 : if tracker/energy-flow
     624            // 2.1a.2.4 Photons
     625               // stays in the tracker -> track available -> gamma ID
     626            else if( (pid == pGAMMA) && fabs(particle->EtaCalo)< DET->CEN_max_tracker ) {
     627                float iEta=UNDEFINED, iPhi=UNDEFINED;
     628                DET->BinEtaPhi(particle->PhiCalo,particle->EtaCalo,iPhi,iEta); // fills in iPhi and iEta
     629                D_CaloTower tower(iEta,iPhi);
     630                // stores the list of towers where to apply the photon ID algorithm. Just a trick for a faster search
     631                list_of_towers_with_photon.addTower(tower);
     632            }
     633            // 2.1a.2.5 : very forward detectors
     634            else if (DET->FLAG_vfd==1) {
     635                // for the moment, only protons are transported
     636                // BUT !!! could be a beam of other particles! (heavy ions?)
     637                // BUT ALSO !!! if very forward muons, or others!
     638              VFD->RomanPots(treeWriter,branchRP220,branchFP420,particle);
     639              VFD->ZDC(treeWriter,branchZDC,particle);
     640            }
     641            // 2.1a.2.6: Zero degree calorimeter
     642            //else if(DET->FLAG_zdc==1) {
     643              //VFD->ZDC(treeWriter,branchZDC,particle);
     644            //}
     645
     646          } // 2.1a.2 : if visible particle
     647      } // loop on all particles 2.1a
     648       
     649
     650      // 2.1b loop on all (activated) towers
     651      // at this stage, list_of_active_towers may contain several times the same tower
     652      // first step is to merge identical towers, by matching their (iEta,iPhi) 
     653      list_of_active_towers.mergeDuplicates();
     654      // Calotower smearing
     655      list_of_active_towers.smearTowers(list_of_calorimeters);
     656
     657      for(unsigned int i=0; i<list_of_active_towers.size(); i++) {
     658        float iEta = list_of_active_towers[i].getEta();
     659        float iPhi = list_of_active_towers[i].getPhi();
     660        float e = list_of_active_towers[i].getE();
     661        if(iEta != UNDEFINED && iPhi != UNDEFINED && e!=0) {
     662           elementCalo = (TRootCalo*) branchCalo->NewEntry();
     663           elementCalo->set(list_of_active_towers[i]);
     664           // not beautiful : should be improved!
     665           TLorentzVector p;
     666           p.SetPtEtaPhiE(list_of_active_towers[i].getET(), iEta, iPhi, e );
     667           PhysicsTower Tower(LorentzVector(p.Px(),p.Py(),p.Pz(),p.E()));
     668           towers.push_back(Tower);
     669        }
     670      } // loop on towers
     671
     672      // 2.1c photon ID
     673      // list_of_towers_with_photon is the list of towers with photon candidates
     674      // already smeared !
     675      // sorts the vector and smears duplicates
     676      list_of_towers_with_photon.mergeDuplicates();
     677
     678      for(unsigned int i=0; i<list_of_towers_with_photon.size(); i++) {
     679          float eta = list_of_towers_with_photon[i].getEta();
     680          float phi = list_of_towers_with_photon[i].getPhi();
     681          D_CaloTower cal(list_of_active_towers.getElement(eta,phi));
     682          if(cal.getEta() != UNDEFINED && cal.getPhi() != UNDEFINED &&  cal.getE() > 0) {
     683            TLorentzVector p;
     684            p.SetPtEtaPhiE(cal.getET(), eta,phi,cal.getE() );
     685            if (cal.getET() > DET->PTCUT_gamma) { gamma.push_back(D_Particle(p,pGAMMA,p.Eta(),p.Phi())); }
     686          }
     687      } // for -- list of photons
     688
     689}  // IF NEW ALGORITHM with energy flow
     690
     691
    480692
    481693
    482694      // 2.2 ********** Output preparation & complex objects  ***********
    483  
    484695      // 2.2.1 ********************* sorting collections by decreasing pt
    485696      DET->SortedVector(electron);
     
    487698        elementElec = (TRootElectron*) branchElectron->NewEntry();
    488699        elementElec->Set(electron[i].Px(),electron[i].Py(),electron[i].Pz(),electron[i].E());
     700        elementElec->EtaCalo = electron[i].EtaCalo();
     701        elementElec->PhiCalo = electron[i].PhiCalo();
    489702        elementElec->Charge = sign(electron[i].PID());
    490703        elementElec->IsolFlag = DET->Isolation(electron[i].Phi(),electron[i].Eta(),TrackCentral,2.0);//isolation based on tracks
     
    495708        elementMu->Charge = sign(muon[i].PID());
    496709        elementMu->Set(muon[i].Px(),muon[i].Py(),muon[i].Pz(),muon[i].E());
     710        elementMu->EtaCalo = muon[i].EtaCalo();
     711        elementMu->PhiCalo = muon[i].PhiCalo();
    497712        elementMu->IsolFlag = DET->Isolation(muon[i].Phi(),muon[i].Eta(),TrackCentral,2.0);
    498713      }
     
    501716        elementPhoton = (TRootPhoton*) branchPhoton->NewEntry();
    502717        elementPhoton->Set(gamma[i].Px(),gamma[i].Py(),gamma[i].Pz(),gamma[i].E());
     718        elementPhoton->EtaCalo = gamma[i].EtaCalo();
     719        elementPhoton->PhiCalo = gamma[i].PhiCalo();
    503720      }
    504721     
     
    522739      elementEtmis->Py = (-PTmis).Py();
    523740     
    524       // 2.2.3 ************* B-tag, tau jets
     741      // 2.2.3 ************* jets, B-tag, tau jets
    525742      sorted_jets=JETRUN->RunJets(input_particles);
    526743      JETRUN->RunJetBtagging(treeWriter, branchJet,sorted_jets,NFCentralQ);
     
    529746      treeWriter->Fill();
    530747    } // 2. Loop over all events ('for' loop)
    531  
     748
     749
    532750  cout <<"**                                                                 **"<< endl;
    533751  cout <<"**                 Exiting detector simulation...                  **"<< endl;
     
    649867  delete treeReader;
    650868  delete DET;
    651 //  delete TRIGT;
     869  delete TRIGT;
    652870  delete TRACP;
    653871  delete JETRUN;
  • trunk/Examples/Trigger_Only.cpp

    r260 r264  
    9494
    9595  //read the datacard input file
    96   string TrigDatacard("");
     96  string TrigDatacard("data/trigger.dat");
    9797  if(argc==3)  TrigDatacard =argv[2];
    9898
  • trunk/Examples/src/Analysis_Ex.cc

    r260 r264  
    155155          D1       = gen->D1;       // particle 1st daughter
    156156          D2       = gen->D2;       // particle 2nd daughter
    157           Charge = gen->Charge;   // electrical charge
     157          Charge = gen->getCharge();   // electrical charge
    158158         
    159159          T      = gen->T;        // particle vertex position (t component)
     
    334334     for(Int_t i=0;i < numElec; i++)Lept[i].SetPxPyPzE(el[i]->Px,el[i]->Py,el[i]->Pz,el[i]->E);
    335335     for(Int_t k = numElec; k < (numElec+mu.GetEntries()); k++)Lept[k].SetPxPyPzE(mu[k-numElec]->Px,mu[k-numElec]->Py,mu[k-numElec]->Pz,mu[k-numElec]->E);
    336    
     336    cout<<"normalement il y a quelque chose... "<<endl;
    337337     //Example how to white a branch in the output file
    338338     inv_mass=(TRootInvm*) INVMASS->NewEntry();
  • trunk/README

    r206 r264  
    104104 - dans ParticleUtil
    105105        eta,phi et eta_calo,phi_calo
     106 - TRootParticle::SetEtaPhiEET : pas fini
    106107
  • trunk/Resolutions.cpp

    r260 r264  
    1 /***********************************************************************
    2 **                                                                    **
    3 **          /----------------------------------------------\          **
    4 **         |  Delphes, a framework for the fast simulation  |         **
    5 **         |       of a  generic collider experiment        |         **
    6 **          \----------------------------------------------/          **
    7 **                                                                    **
    8 **                                                                    **
    9 **   This package uses:                                               **
    10 **   ------------------                                               **
    11 **   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
    12 **   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
    13 **   FROG: [hep-ex/0901.2718v1]                                       **
    14 **                                                                    **
    15 ** ------------------------------------------------------------------ **
    16 **                                                                    **
    17 **   Main authors:                                                    **
    18 **   -------------                                                    **
    19 **                                                                    **
    20 **                Severine Ovyn                Xavier Rouby           **
    21 **          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
    22 **                                                                    **
    23 **         Center for Particle Physics and Phenomenology (CP3)        **
    24 **                Universite catholique de Louvain (UCL)              **       
    25 **                     Louvain-la-Neuve, Belgium                      **           
    26 **                                                                    **
    27 **                      Copyright (C) 2008-2009,                      **
    28 **                        All rights reserved.                        ** 
    29 **                                                                    **
    30 ***********************************************************************/
     1/*
     2  ---- FastSim ----
     3  A Fast Simulator for general purpose LHC detector
     4  S. Ovyn ~~~~ severine.ovyn@uclouvain.be
     5
     6  Center for Particle Physics and Phenomenology (CP3)
     7  Universite Catholique de Louvain (UCL)
     8  Louvain-la-Neuve, Belgium
     9*/
     10
     11/// \file Smearing.cpp
     12/// \brief executable for the FastSim
    3113
    3214#include "TChain.h"
     
    4729#include "JetsUtil.h"
    4830#include "BFieldProp.h"
     31
     32//#include "PseudoJet.hh"
     33//#include "ClusterSequence.hh"
    4934
    5035#include<vector>
     
    7560       if(abs(gen1->PID)==15)
    7661         {
    77 cout<<"au moins on a un tau "<<endl;
    7862            int d1=gen1->D1;
    7963            int d2=gen1->D2;
    80 cout<<"il a des filles? "<<endl;
    8164            if((d1 < array.GetEntries()) && (d1 > 0) && (d2 < array.GetEntries()) && (d2 > 0))
    8265               {
    8366                 tauhad=true;
    8467                 for(int d=d1; d < d2+1; d++)
    85                     {cout<<abs(array[d]->PID)<<"  "<<endl;
     68                    {
    8669                      if(abs(array[d]->PID)== pE || abs(array[d]->PID)== pMU)tauhad=false;
    8770                    }
     
    11598   {
    11699      TLorentzVector Att;
    117       Att.SetPxPyPzE(jet->Px,jet->Py,jet->Pz,jet->E);
     100      Att.SetPtEtaPhiE(jet->PT,jet->Eta,jet->Phi,jet->E);
    118101      if(DeltaR(JET.Phi(),JET.Eta(),Att.Phi(),Att.Eta()) < deltaRtest)
    119102        {
     
    137120   {
    138121      TLorentzVector Att;
    139       Att.SetPxPyPzE(elec->Px,elec->Py,elec->Pz,elec->E);
     122      Att.SetPtEtaPhiE(elec->PT,elec->Eta,elec->Phi,elec->E);
    140123      if(DeltaR(ELEC.Phi(),ELEC.Eta(),Att.Phi(),Att.Eta()) < deltaRtest)
    141124        {
     
    313296                 case pE: // all electrons with eta < DET->MAX_CALO_FWD
    314297                    PairingElec(recoMomentum,genMomentum,branchElec);
    315                     if(recoMomentum.Pt()>1){
     298                    if(recoMomentum.E()!=0){
    316299                     elementElec=(RESOLELEC*) branchelec->NewEntry();
    317300                     elementElec->E = genMomentum.E();
     
    331314
    332315        } // while
    333       
     316     
    334317      //compute missing transverse energy from calo towers   
    335318      TIter itCalo((TCollection*)branchTowers);
     
    340323      while( (calo = (TRootCalo*) itCalo.Next()) )
    341324           {
    342           //Att.SetPxPyPzE(towers[i].fourVector.px, towers[i].fourVector.py, towers[i].fourVector.pz, towers[i].fourVector.E);
    343           Att.SetPtEtaPhiE(calo->PT,calo->Eta,calo->Phi,calo->E);
    344           towers.push_back(Att);
    345           if(fabs(Att.Eta()) < DET->CEN_max_calo_fwd)
    346             {
    347                ScalarEt = ScalarEt + Att.Et();
    348                PTmisReco = PTmisReco + Att;
    349             }
    350         }
    351      
     325             if(calo->E !=0){
     326             Att.SetPtEtaPhiE(calo->getET(),calo->Eta,calo->Phi,calo->E);
     327             towers.push_back(Att);
     328             if(fabs(Att.Eta()) < DET->CEN_max_calo_fwd)
     329               {
     330                  ScalarEt = ScalarEt + calo->getET();
     331                  PTmisReco = PTmisReco + Att;
     332               }
     333           } 
     334      }
    352335      elementEtmis= (ETMIS*) branchetmis->NewEntry();
    353336      elementEtmis->Et = (PTmisGEN).Pt();
     
    363346
    364347      TSimpleArray<TRootGenParticle> TausHadr = TauHadr(branchGen);
    365 cout<<"nombre de tau-jets "<<TausHadr.GetEntries()<<endl;
    366348
    367349      TLorentzVector JETreco(0,0,0,0);
     
    397379                    if( (EnergySmallCone(towers,JETT.Eta(),JETT.Phi(),DET->TAU_energy_scone,DET->JET_seed)/JETT.E()) > 0.95
    398380                     &&  (NumTracks(branchTracks,DET->TAU_track_pt,JETT.Eta(),JETT.Phi(),DET->TAU_track_scone))==1)numTauRec++;
    399                    
    400381                 }
    401382              }
     
    404385       
    405386      } // for itJet : loop on all jets
     387//cout<<"i"<<endl;
    406388     
    407389      treeWriter->Fill();
    408390    } // Loop over all events
    409391  treeWriter->Write();
    410   float frac = numTauRec/numTau; 
    411   cout<<numTauRec<<endl;
    412   cout<<numTau<<endl;
     392float frac = numTauRec/numTau; 
     393cout<<numTauRec<<endl;
     394cout<<numTau<<endl;
    413395
    414396  cout << "** Exiting..." << endl;
  • trunk/TODO

    r226 r264  
    1818 - copy constructors des classes ; passage par reference ; gprof tool <-> option -gp
    1919 - valgrind <-> -g <-> definitely lost / probably lost
    20  - include .cpp de frog???
     20 - pourquoi doit-on inclure les fichiers.cpp de frog???
    2121 - TreeClassesLinkDef ???
     22 - libHector.so = libUtilities.so !!!!!
     23 - FLAG_zdc <-> pas complet, notamment dans le fichier log
  • trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h

    r220 r264  
    1313 *  present in the data members of the Block TRoot class.
    1414 *
    15  *  $Date: 2009-02-02 11:32:12 $
    16  *  $Revision: 1.11 $
     15 *  $Date: 2009-02-11 09:19:14 $
     16 *  $Revision: 1.12 $
    1717 *
    1818 * 
     
    2424#include "TObject.h"
    2525#include "BlockCompare.h"
     26#include "interface/D_Constants.h"
     27#include "interface/CaloUtil.h"
    2628
    2729class TSortableObject: public TObject
     
    147149  float Pz; // particle momentum vector (z component) in GeV
    148150
    149   float PT; // particle transverse momentum in GeV
    150151  float Eta; // particle pseudorapidity 
    151152  float Phi; // particle azimuthal angle in rad
    152153
     154  float EtaCalo; // particle pseudorapidity when entering the calo,
     155  float PhiCalo; // particle azimuthal angle in rad when entering the calo
     156
    153157  void Set(const TLorentzVector& momentum);
    154158  void Set(const float px, const float py, const float pz, const float e);
    155   static TCompare *fgCompare; //!
    156   const TCompare *GetCompare() const { return fgCompare; }
     159  void SetEtaPhi(const float eta, const float phi) {Eta=eta; Phi=phi;};
     160  void SetEtaPhiCalo(const float eta, const float phi) {EtaCalo=eta; PhiCalo=phi;};
     161  void SetEtaPhiEET(const float eta, const float phi, const float e, const float et);
     162  static TCompare *fgCompare; //!
     163  const TCompare *GetCompare() const { return fgCompare; }
     164  //void SetEem_Ehad(const float sE_em, const float sE_had) {} ; // sets E_em and E_had, computes E and ET
     165  float PT; // particle transverse momentum in GeV
     166  //const float getEtaGen() const {return _EtaGen;}
     167  //const float getPhiGen() const {return _PhiGen;}
     168
     169
     170//protected:
     171  //float EGen, _EtaGen, _PhiGen; // from the generator: energy, eta, phi
    157172
    158173  ClassDef(TRootParticle, 1)
     
    165180
    166181public:
    167   TRootGenParticle() {};
     182  TRootGenParticle() {_initialised=false;}
    168183  int PID; // particle HEP ID number [RawHepEventParticle::pid()]
    169184  int Status; // particle status [RawHepEventParticle::status()]
     
    172187  int D1; // particle 1st daughter [RawHepEventParticle::daughter1() - 1]
    173188  int D2; // particle 2nd daughter [RawHepEventParticle::daughter2() - 1]
    174   float Charge; // electrical charge
    175189
    176190  float T; // particle vertex position (t component) [RawHepEventParticle::t()]
     
    179193  float Z; // particle vertex position (z component) [RawHepEventParticle::z()]
    180194  float M;
    181   static TCompare *fgCompare; //!
    182 
     195  void setFractions();
     196  const float getCharge() const {return Charge;};
     197  const float getFem()  {if(!_initialised) setFractions(); return _Fem;}
     198  const float getFhad() {if(!_initialised) setFractions(); return _Fhad;}
     199
     200  float Charge;      // electrical charge
     201
     202  static TCompare *fgCompare; //!
     203 protected:
     204  float _Fem, _Fhad; // fractions of energy deposit
     205  bool _initialised;
    183206  ClassDef(TRootGenParticle, 1)
    184207};
     208
    185209
    186210//------------------------------------------------------------------------------
     
    225249//---------------------------------------------------------------------------
    226250
    227 class TRootTracks: public TRootParticle
    228 {
    229 public:
    230   TRootTracks() : Etaout(0), Phiout(0) {};
    231   static TCompare *fgCompare; //!
    232  
     251class D_Track : public TSortableObject {
     252//class D_Track : public TRootParticle {
     253 public:
     254    D_Track(); // needed for storage in ExRootAnalysis
     255    D_Track(const D_Track& track);
     256    D_Track(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt);
     257    D_Track& operator=(const D_Track& track);
     258    void Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt);
     259    const TLorentzVector GetFourVector() const;
     260    const float getEta() const {return Eta;}
     261    const float getPhi() const {return Phi;}
     262    const float getEtaOuter() const {return EtaOuter;}
     263    const float getPhiOuter() const {return PhiOuter;}
     264    const float getE() const {return E;}
     265    const float getPx() const {return Px;}
     266    const float getPy() const {return Py;}
     267    const float getPz() const {return Pz;}
     268    const float getPT() const {return PT;}
     269
     270  static TCompare *fgCompare; //!
     271  const TCompare *GetCompare() const { return fgCompare; }
     272 protected:
     273    float Eta, Phi; // (eta,phi) at the beginning of the track
     274    float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
     275    float PT, E, Px, Py, Pz;  // transverse momentum
     276 ClassDef(D_Track, 1)
     277};
     278
     279
     280class TRootTracks: public TRootParticle  {
     281public:
     282  TRootTracks() {} // : Etaout(0), Phiout(0) {};
     283  static TCompare *fgCompare; //!
     284  TRootTracks(const D_Track& track);
     285  float E;  // particle energy in GeV
     286  float Px; // particle momentum vector (x component) in GeV
     287  float Py; // particle momentum vector (y component) in GeV
     288  float Pz; // particle momentum vector (z component) in GeV
     289
     290  float Eta; // particle pseudorapidity
     291  float Phi; // particle azimuthal angle in rad
     292
     293  float EtaCalo; // particle pseudorapidity when entering the calo,
     294  float PhiCalo; // particle azimuthal angle in rad when entering the calo
    233295//  float X, Y, Z; // coordinates of the beginning of the track
    234296//  float Xout, Yout, Zout; // coordinates of the end of the track
    235   float Etaout, Phiout; // coordinates of the end of the track
     297  //float Etaout, Phiout; // coordinates of the end of the track
    236298//  void SetPosition(const float x, const float y, const float z) {X=x; Y=y; Z=z;}
    237299//  void SetPositionOut(const float x, const float y, const float z) {Xout=x; Yout=y; Zout=z;}
     
    241303//---------------------------------------------------------------------------
    242304
    243 class TRootCalo: public TRootParticle
    244 {
     305/*class TRootCalo: public TRootParticle
    245306public:
    246307  TRootCalo() {};
     
    248309
    249310  ClassDef(TRootCalo, 1)
     311};
     312*/
     313
     314//class TRootCalo: public TSortableObject {
     315class TRootCalo: public TRootParticle {
     316 public:
     317   TRootCalo() ;
     318   TRootCalo(const TRootCalo& cal);
     319   TRootCalo& operator=(const TRootCalo& cal);
     320   void set(const D_CaloTower&  cal);
     321   static TCompare *fgCompare; //!
     322 //  const TCompare *GetCompare() const { return fgCompare; }
     323   const float getET() const {return ET;}
     324 
     325 protected:
     326    //float Eta, Phi;    // segmented eta, phi
     327    float E_em, E_had; // electromagnetic and hadronic components of the tower energy
     328    //float E;
     329    float ET;       // total energy and transverse energy   
     330   ClassDef(TRootCalo, 1)
    250331};
    251332
     
    340421};
    341422
    342 //---------------------------------------------------------------------------
    343 
    344423#endif // BLOCKCLASSES_H
    345424
  • trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc

    r220 r264  
    1111 *  to preserve mother-dautherlinks between particles.
    1212 *
    13  *  $Date: 2009-02-02 11:32:01 $
    14  *  $Revision: 1.7 $
     13 *  $Date: 2009-02-11 09:19:14 $
     14 *  $Revision: 1.8 $
    1515 *
    1616 * 
     
    2222#include "BlockCompare.h"
    2323#include "TLorentzVector.h"
     24#include <cmath>
    2425
    2526TCompare *TRootGenParticle::fgCompare = 0;
     
    3839TCompare *TRootRomanPotHits::fgCompare =0;
    3940TCompare *TRootTrigger::fgCompare =0;
     41//TCompare *D_CaloTower::fgCompare=0;
     42TCompare *D_Track::fgCompare=0;
    4043
    4144void TRootParticle::Set(const TLorentzVector& momentum) {
     
    6164}
    6265
     66void TRootParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) {
     67   Eta = eta; Phi = phi; E = e; PT = et;
     68   //float theta = 2* atan(exp(-Eta);
     69   Px = PT*cos(Phi);
     70   Py = PT*sin(Phi);
     71}
    6372
     73
     74void TRootGenParticle::setFractions() {
     75  switch(abs(PID)) {
     76    default:  _Fem = 0; _Fhad=1; break;
     77    case(pE):
     78    case(pGAMMA):
     79    case(pPI0):
     80        _Fem = 1; _Fhad=0; break;
     81    case(pNU1):
     82    case(pNU2):
     83    case(pNU3):
     84    case(pMU):
     85        _Fem =0; _Fhad=0; break;
     86    case(pK0S):
     87    case(pLAMBDA):
     88        _Fem=0.3; _Fhad=0.7; break;
     89  }
     90  _initialised=true;
     91}
     92
     93    float Eta, Phi; // (eta,phi) at the beginning of the track
     94    float EtaOuter, PhiOuter; // (eta,phi) at the end of the track
     95    float PT, E, Px, Py, Pz;
     96
     97D_Track::D_Track() :
     98        Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED),
     99        PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED) {}
     100
     101D_Track::D_Track(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) :
     102        Eta(inEta), Phi(inPhi), EtaOuter(outEta), PhiOuter(outPhi),
     103        PT(pt) {
     104        TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
     105        Px = p.Px(); Py = p.Py(); Pz = p.Pz();  E=p.E();
     106}
     107
     108D_Track::D_Track(const D_Track& track) :
     109        Eta(track.Eta), Phi(track.Phi),
     110        EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter),
     111        PT(track.PT), E(track.E), Px(track.Px), Py(track.Py), Pz(track.Pz) {}
     112
     113D_Track& D_Track::operator=(const D_Track& track) {
     114  if(this == &track) return *this;
     115        Eta = track.Eta;             Phi = track.Phi;
     116        EtaOuter = track.EtaOuter;   PhiOuter = track.PhiOuter;
     117        PT = track.PT; E = track.E;  Px = track.Px;  Py= track.Py; Pz =track.Pz;
     118  return *this;
     119}
     120
     121void D_Track::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) {
     122        Eta= inEta; Phi=inPhi;  EtaOuter=outEta; PhiOuter=outPhi; PT=pt;
     123        TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
     124        Px = p.Px(); Py = p.Py(); Pz = p.Pz();  E=p.E();
     125}
     126
     127const TLorentzVector D_Track::GetFourVector() const {
     128        TLorentzVector v;
     129        v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta));
     130        return TLorentzVector(v);
     131}
     132
     133TRootCalo::TRootCalo() :
     134        E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {}
     135        //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {}
     136
     137TRootCalo::TRootCalo(const TRootCalo& cal) {
     138        E_em=cal.E_em; E_had=cal.E_had;  ET=cal.ET;
     139        //Eta =cal.Eta;  Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had;  E=cal.E;   ET=cal.ET;
     140}
     141
     142TRootCalo& TRootCalo::operator=(const TRootCalo& cal) {
     143   if(this==&cal) return *this;
     144        Eta =cal.Eta;  Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had;  E=cal.E;   ET=cal.ET;
     145   return *this;
     146}
     147
     148void TRootCalo::set(const D_CaloTower& cal) {
     149        Eta =cal.getEta(); Phi=cal.getPhi();
     150        E_em=cal.getEem(); E_had=cal.getEhad();
     151        E   =cal.getE();   ET   =cal.getET();
     152        EtaCalo = cal.getEta();
     153        PhiCalo = cal.getPhi();
     154}
     155
     156
     157TRootTracks::TRootTracks(const D_Track& track) :
     158   E(track.getE()), Px(track.getPx()), Py(track.getPy()), Pz(track.getPz()),
     159   Eta(track.getEta()), Phi(track.getPhi()),
     160   /*Etaout(track.getEtaOuter()),*/ EtaCalo(track.getEtaOuter()), /*Phiout(track.getPhiOuter()),*/ PhiCalo(track.getPhiOuter()) {}
     161
  • trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h

    r67 r264  
    44 *  Lists classes to be included in cint dicitonary
    55 *
    6  *  $Date: 2008-12-02 11:14:45 $
    7  *  $Revision: 1.2 $
     6 *  $Date: 2009-02-11 09:19:14 $
     7 *  $Revision: 1.3 $
    88 *
    99 * 
     
    1313
    1414#include "Utilities/ExRootAnalysis/interface/BlockClasses.h"
     15#include "interface/D_Constants.h"
    1516
    1617#ifdef __CINT__
     
    3940#pragma link C++ class TRootLHEFEvent+;
    4041#pragma link C++ class TRootLHEFParticle+;
     42#pragma link C++ class D_Track+;
     43//#pragma link C++ class D_CaloTower+;
    4144
    4245
  • trunk/Utilities/FROG/config.txt

    r112 r264  
    33InputVisFile ={../../DelphesToFrog.vis};
    44
    5 GeomToDisplay = {910000000,920000000,930000000,940000000};
     5//GeomToDisplay = {910000000,920000000,930000000,940000000};
    66EventToDisplay = {21000000};
    77
  • trunk/Utilities/Hector/src/H_AbstractBeamLine.cc

    r234 r264  
    485485        /// @param offset In meters
    486486
    487         extern int relative_energy;
     487        extern bool relative_energy;
    488488        if(!relative_energy) {
    489489                vector<H_OpticalElement*>::iterator element_i;
  • trunk/VERSION

    r261 r264  
    1 1.4beta
     1x.y
  • trunk/data/DataCardDet.dat

    r259 r264  
    1111ELG_Scen          0.05              // S term for central ECAL
    1212ELG_Ncen          0.25              // N term for central ECAL
    13 ELG_Ccen          0.005             // C term for central ECAL
    14 ELG_Sfwd          2.084             // S term for FCAL
    15 ELG_Nfwd          0.0               // N term for FCAL
    16 ELG_Cfwd          0.107             // C term for FCAL
     13ELG_Ccen          0.005              // C term for central ECAL
     14ELG_Cfwd          0.107             // S term for forward ECAL
     15ELG_Sfwd          2.084             // C term for forward ECAL
     16ELG_Nfwd          0.0               // N term for central ECAL
    1717
    1818# Energy resolution for hadrons in ecal/hcal/hf
    1919# \sigma/E = C + N/E + S/\sqrt{E}, E in GeV
    20 HAD_Shcal         1.5               // S term for central HCAL
     20HAD_Shcal         1.5               // S term for central HCAL // hadronic calorimeter
    2121HAD_Nhcal         0.                // N term for central HCAL
    2222HAD_Chcal         0.05              // C term for central HCAL
    23 HAD_Shf           2.7               // S term for FCAL
    24 HAD_Nhf           0.                // N term for FCAL
    25 HAD_Chf           0.13              // C term for FCAL
     23HAD_Shf           2.7               // S term for HF // forward calorimeter
     24HAD_Nhf           0.                // N term for HF
     25HAD_Chf           0.13              // C term for HF
    2626
    2727# Muon smearing
     
    2929
    3030# Tracking efficiencies
    31 TRACK_ptmin       0.9               // minimal pt needed to reach the calorimeter in GeV
     31TRACK_ptmin       0.0               // minimal pt needed to reach the calorimeter in GeV
    3232TRACK_eff         100               // efficiency associated to the tracking (%)
    3333
     
    4848
    4949# Thresholds for reconstructed objetcs, Pt in GeV
    50 PTCUT_elec       10.0
    51 PTCUT_muon       10.0
    52 PTCUT_jet        20.0
    53 PTCUT_gamma      10.0
    54 PTCUT_taujet     10.0
     50PTCUT_elec       0.0
     51PTCUT_muon       0.0
     52PTCUT_jet        0.0
     53PTCUT_gamma      0.0
     54PTCUT_taujet     0.0
    5555
    5656# General jet variable
     
    6565
    6666# FLAGS
    67 FLAG_bfield      1                       //1 to run the bfield propagation else 0
     67FLAG_bfield      0                       //1 to run the bfield propagation else 0
    6868FLAG_vfd         1                       //1 to run the very forward detectors else 0
    6969FLAG_trigger     1                       //1 to run the trigger selection else 0
     
    8888RP_420_s          420                   // distance of the RP to the IP, in meters
    8989RP_420_x          0.004                 // distance of the RP to the beam, in meters
    90 RP_beam1Card      data/LHCB1IR5_v6.500.tfs
    91 RP_beam2Card      data/LHCB2IR5_v6.500.tfs
    92 RP_IP_name        IP5
    93 
    9490
    9591# In case FROG event display allowed
  • trunk/data/DataCardDet_CMS.dat

    r259 r264  
    2929
    3030# Tracking efficiencies
    31 TRACK_ptmin       0.9               // minimal pt needed to reach the calorimeter in GeV
     31TRACK_ptmin       0.0               // minimal pt needed to reach the calorimeter in GeV
    3232TRACK_eff         100               // efficiency associated to the tracking (%)
    3333
     
    6767FLAG_bfield      1                       //1 to run the bfield propagation else 0
    6868FLAG_vfd         1                       //1 to run the very forward detectors else 0
    69 FLAG_trigger     1                       //1 to run the trigger selection else 0
    70 FLAG_frog        1                       //1 to run the FROG event display
     69FLAG_trigger     0                       //1 to run the trigger selection else 0
     70FLAG_frog        0                       //1 to run the FROG event display
    7171
    7272# In case BField propagation allowed
  • trunk/data/trigger.dat

    r249 r264  
    1 TRIGGER CARD      # DO NOT REMOVE THIS IS A TAG!
     1#TRIGGER CARD      # DO NOT REMOVE THIS IS A TAG!
    22
    33
  • trunk/interface/BFieldProp.h

    r260 r264  
    5353
    5454    // Propagation and bfield are very similar. At the end, after code cleaning,
    55     // onle bfield will remain in this class
     55    // only bfield will remain in this class
    5656    void Propagation(const TRootGenParticle *Part,TLorentzVector &genMomentum);
    57     void bfield(const TRootGenParticle *Part, float& etacalo, float& phicalo);
     57    void bfield(TRootGenParticle *Part); // fills in Part->EtaCalo and Part->PhiCalo
    5858
    5959
  • trunk/interface/FrogUtil.h

    r260 r264  
    3434
    3535
     36/// \file FrogUtil.h
     37/// \brief FrogDisplay class
     38
    3639#include "SmearUtil.h"
    3740#include "FROG_Events.h"
  • trunk/interface/SmearUtil.h

    r260 r264  
    4040#include "TLorentzVector.h"
    4141
     42#include "D_Constants.h"
     43#include "CaloUtil.h"
    4244#include "BlockClasses.h"
    4345#include "TSimpleArray.h"
     
    4648using namespace std;
    4749
    48 class ParticleUtil {
     50class D_Particle {
    4951
    5052 public:
    51   ParticleUtil(const TLorentzVector &genMomentum, int pid);
    52 
    53   float E() {return _e;}    // particle energy [GeV]
    54   float Px() {return _px;}  // horizontal coordinate of momentum [GeV]
    55   float Py() {return _py;}  // vertical coordinate of momentum [GeV]
    56   float Pz() {return _pz;}  // longitudinal coordinate of momentum [GeV]
    57   float Pt() {return _pt;}  // transverse momentum [GeV]
    58   float EtaCalo() {return _etaCalo;}  // pseudorapidity
    59   float Eta() {return _eta;}  // pseudorapidity
    60   float PhiCalo() {return _phiCalo;}  // azimuthal angle
    61   float Phi() {return _phi;}  // azimuthal angle
    62   int PID() {return _pid;}  // particle energy in [GeV]
     53  D_Particle(const TLorentzVector & p, const int pid, const float etacalo, const float phicalo) :
     54        _fourmomentum(p), _pid(pid), _etaCalo(etacalo), _phiCalo(phicalo) {}
     55  //D_Particle(const float e, const float eta, const float phi, const float pt, const int pid) :
     56  //    _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) { TLorentzVector p; p.SetPtEtaPhiE(pt,eta,phi,e); _fourmomentum = p; }
     57  D_Particle(const float px, const float py, const float pz, const float e, const int pid) :
     58        _fourmomentum(px,py,pz,e), _pid(pid), _etaCalo(UNDEFINED), _phiCalo(UNDEFINED) {}
     59
     60  const float E() const {return _fourmomentum.E();}    // particle energy [GeV]
     61  const float Px() const {return _fourmomentum.Px();}  // horizontal coordinate of momentum [GeV]
     62  const float Py() const {return _fourmomentum.Py();}  // vertical coordinate of momentum [GeV]
     63  const float Pz() const {return _fourmomentum.Pz();}  // longitudinal coordinate of momentum [GeV]
     64  const float Pt() const {return _fourmomentum.Pt();}  // transverse momentum [GeV]
     65  const float EtaCalo() const {return _etaCalo;}  // pseudorapidity
     66  const float Eta() const {return _fourmomentum.Eta();}  // pseudorapidity
     67  const float PhiCalo() const {return _phiCalo;}  // azimuthal angle
     68  const float Phi() const  {return _fourmomentum.Phi();}  // azimuthal angle
     69  const int PID() const {return _pid;}  // particle energy in [GeV]
     70  const TLorentzVector& getFourMomentum() const {return _fourmomentum;}
    6371
    6472 private:
    65   float _e, _px, _py, _pz, _pt;
    66   float _eta, _etaCalo, _phi, _phiCalo;
     73  TLorentzVector _fourmomentum;
    6774  int _pid;
     75  float _etaCalo, _phiCalo;
    6876};
    69 
    70 #ifndef __PI__
    71 #define __PI__
    72 extern const float pi = 3.14159265358979312;
    73 #endif
    7477
    7578class RESOLution
     
    9396  float VFD_s_zdc;   // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
    9497
    95   float  RP_220_s; // distance of the RP to the IP, in meters
    96   float  RP_220_x; // distance of the RP to the beam, in meters
    97   float  RP_420_s; // distance of the RP to the IP, in meters
    98   float  RP_420_x; // distance of the RP to the beam, in meters
     98  float RP_220_s; // distance of the RP to the IP, in meters
     99  float RP_220_x; // distance of the RP to the beam, in meters
     100  float RP_420_s; // distance of the RP to the IP, in meters
     101  float RP_420_x; // distance of the RP to the beam, in meters
    99102  string RP_beam1Card; //
    100103  string RP_beam2Card; //
     
    186189 int FLAG_bfield;               //flag for bfield propagation
    187190 int FLAG_vfd;                  //flag for very forward detector
     191 int FLAG_zdc;                  //flag for very forward detector
    188192 
    189193 int NEvents_Frog;
     
    191195
    192196  // to sort a vector
    193   void SortedVector(vector<ParticleUtil> &vect);
     197  //void SortedVector(vector<ParticleUtil> &vect);
     198  void SortedVector(vector<D_Particle> &vect);
    194199
    195200  /// Reads the data card for the initialisation of the parameters
     
    227232
    228233};
    229 
    230 
    231 // particles PID (PDG ID)
    232 const int pU   = 1;    // c quark
    233 const int pD   = 2;    // b quark
    234 const int pS   = 3;    // s quark
    235 const int pC   = 4;    // c quark
    236 const int pB   = 5;    // b quark
    237 const int pE   = 11;   // e
    238 const int pNU1 = 12;   // nu_e
    239 const int pMU  = 13;   // mu
    240 const int pNU2 = 14;   // nu_mu
    241 const int pTAU = 15;   // tau
    242 const int pNU3 = 16;   // nu_tau
    243 const int pGLUON = 21; // gluon
    244 const int pGAMMA = 22; // gamma
    245 const int pW   = 24;   // W
    246 const int pP   = 2212; // proton
    247 const int pN   = 2112; // neutron
    248 const int pPI0 = 111;  // pi_0
    249 const int pK0L = 130;  // K^0_L
    250 const int pK0S = 310;  // K^0_S
    251 const int pLAMBDA = 3122; // Lambda
    252 const int pSIGMA0 = 3212;  // Sigma^0
    253 const int pDELTA0 = 2114;  // Delta^0
    254 
    255 const double speed_of_light = 299792458; // m/s
    256 const float UNDEFINED=-9999.;
    257 
    258234
    259235// ** returns the sign (+1 or -1) or an integer
  • trunk/interface/TreeClasses.h

    r222 r264  
    11#ifndef TreeClasses_h
    22#define TreeClasses_h
     3
     4/***********************************************************************
     5**                                                                    **
     6**          /----------------------------------------------\          **
     7**         |  Delphes, a framework for the fast simulation  |         **
     8**         |       of a  generic collider experiment        |         **
     9**          \----------------------------------------------/          **
     10**                                                                    **
     11**                                                                    **
     12**   This package uses:                                               **
     13**   ------------------                                               **
     14**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     15**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     16**   FROG: [hep-ex/0901.2718v1]                                       **
     17**                                                                    **
     18** ------------------------------------------------------------------ **
     19**                                                                    **
     20**   Main authors:                                                    **
     21**   -------------                                                    **
     22**                                                                    **
     23**                Severine Ovyn                Xavier Rouby           **
     24**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     25**                                                                    **
     26**         Center for Particle Physics and Phenomenology (CP3)        **
     27**                Universite catholique de Louvain (UCL)              **       
     28**                     Louvain-la-Neuve, Belgium                      **           
     29**                                                                    **
     30**                      Copyright (C) 2008-2009,                      **
     31**                        All rights reserved.                        ** 
     32**                                                                    **
     33***********************************************************************/
     34
    335
    436#include "TObject.h"
  • trunk/interface/TriggerUtil.h

    r260 r264  
    4747 public:
    4848
    49   TriggerBit(){};
     49  TriggerBit();
    5050  TriggerBit(const TriggerBit& tb);
    5151  TriggerBit& operator=(const TriggerBit& tb);
     
    8787
    8888  void TriggerCardReader(const string& filename="data/trigger.dat");
     89  // avant, ça s'appellait TriggerReader
     90  // appelle la méthode TriggerBit::GetTrigCondition
     91
     92 
    8993  void PrintTriggerTable(const string& LogName);
     94  // fait un cout des triggers bits, c'est toujours pratique
     95  // appelle la méthode TriggerBit::PriniTrigCondition
     96 
    9097  bool GetGlobalResult(TClonesArray *branchElecTrig, TClonesArray *branchMuonTrig,
    9198      TClonesArray *branchJetTrig, TClonesArray *branchTauJetTrig,
     
    93100
    94101  void WriteResult();
     102    // sauve dans le TTree
     103    // ce nom est stupide, faut le changer
    95104   
    96105 private:
     106  //bool Evaluate( int event_i );
     107  // boucle sur list_of_trigger_bits, comme on a dit
     108  // appelle la methode TriggerBit::Evaluate ou TriggerBit::GetResult (à voir)
     109  // renvoie la réponse globale du trigger
     110  // à la fin, mettre has_been_evaluated = true;
     111  // voir le NB ci-dessous
    97112 
    98113  vector<TriggerBit> list_of_trigger_bits;
    99114  bool has_been_evaluated;
    100115  bool GlobalResult;
     116  int event_i;
    101117
    102118};
  • trunk/routines/plot_performances.C

    r197 r264  
     1/***********************************************************************
     2**                                                                    **
     3**          /----------------------------------------------\          **
     4**         |  Delphes, a framework for the fast simulation  |         **
     5**         |       of a  generic collider experiment        |         **
     6**          \----------------------------------------------/          **
     7**                                                                    **
     8**                                                                    **
     9**   This package uses:                                               **
     10**   ------------------                                               **
     11**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     12**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     13**   FROG: [hep-ex/0901.2718v1]                                       **
     14**                                                                    **
     15** ------------------------------------------------------------------ **
     16**                                                                    **
     17**   Main authors:                                                    **
     18**   -------------                                                    **
     19**                                                                    **
     20**                Severine Ovyn                Xavier Rouby           **
     21**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     22**                                                                    **
     23**         Center for Particle Physics and Phenomenology (CP3)        **
     24**                Universite catholique de Louvain (UCL)              **       
     25**                     Louvain-la-Neuve, Belgium                      **           
     26**                                                                    **
     27**                      Copyright (C) 2008-2009,                      **
     28**                        All rights reserved.                        ** 
     29**                                                                    **
     30***********************************************************************/
     31
     32
    133#include "interface/FuncDef.h"
    234#include "TGraph.h"
  • trunk/routines/resolutions.C

    r258 r264  
    328328void General()
    329329{
    330   //JetResol();
    331   //ElecResol();
    332   //ETmisResol();
    333   TauJetInfo();
    334  
    335 }
    336 
    337 
     330  JetResol();
     331  ElecResol();
     332  ETmisResol();
     333  //TauJetInfo();
     334 
     335}
     336
     337
  • trunk/src/BFieldProp.cc

    r260 r264  
    3636
    3737//------------------------------------------------------------------------------
     38extern const float UNDEFINED;
    3839
    3940TrackPropagation::TrackPropagation(){
     
    315316
    316317
    317 void TrackPropagation::bfield(const TRootGenParticle *Part, float& etacalo, float& phicalo) {
     318void TrackPropagation::bfield(TRootGenParticle *Part) {
    318319
    319320  // initialisation, valid for z_max==0, R_max==0 and q==0
    320   etacalo = Part->Eta;
    321   phicalo = -atan2(Part->Px,Part->Py);
     321  Part->EtaCalo = Part->Eta;
     322  Part->PhiCalo = Part->Phi;//-atan2(Part->Px,Part->Py);
     323
     324  if (!DET->FLAG_bfield ) return;
    322325
    323326  q  = Charge(Part->PID);
     
    386389              Eta_t = - log(tan(Theta_t/2.));
    387390      } else{
    388                 Theta_t=0; Eta_t = 9999;
     391                Theta_t=0; Eta_t = UNDEFINED;
    389392      }
    390393/*      Not needed here. but these formulae are correct -------
     
    399402        momentum.SetPxPyPzE(Px_t,Py_t,Pz_t,E_t);
    400403*/
    401         etacalo = Eta_t;
    402         phicalo = Phi_t;
     404        Part->EtaCalo = Eta_t;
     405        Part->PhiCalo = Phi_t;
    403406        return;
    404407// test zone ---
     
    436439
    437440  } else { // if B_x or B_y are non zero: longer computation
    438 
     441//cout << "bfield de loic\n";
    439442  float Xvertex1 = Part->X;
    440443  float Yvertex1 = Part->Y;
     
    511514  if(x!=0 && y!=0 && z!=0) {
    512515          Theta = atan2(sqrt(r2),z);
    513           etacalo  = -log(tan(Theta/2.));
    514           phicalo = atan2(y,x);
     516          Part->EtaCalo  = -log(tan(Theta/2.));
     517          Part->PhiCalo = atan2(y,x);
    515518          //momentum.SetPtEtaPhiE(Part->PT,eta,phi,Part->E);
    516519  }
  • trunk/src/HEPEVTConverter.cc

    r245 r264  
     1/***********************************************************************
     2**                                                                    **
     3**          /----------------------------------------------\          **
     4**         |  Delphes, a framework for the fast simulation  |         **
     5**         |       of a  generic collider experiment        |         **
     6**          \----------------------------------------------/          **
     7**                                                                    **
     8**                                                                    **
     9**   This package uses:                                               **
     10**   ------------------                                               **
     11**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     12**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     13**   FROG: [hep-ex/0901.2718v1]                                       **
     14**                                                                    **
     15** ------------------------------------------------------------------ **
     16**                                                                    **
     17**   Main authors:                                                    **
     18**   -------------                                                    **
     19**                                                                    **
     20**                Severine Ovyn                Xavier Rouby           **
     21**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     22**                                                                    **
     23**         Center for Particle Physics and Phenomenology (CP3)        **
     24**                Universite catholique de Louvain (UCL)              **       
     25**                     Louvain-la-Neuve, Belgium                      **           
     26**                                                                    **
     27**                      Copyright (C) 2008-2009,                      **
     28**                        All rights reserved.                        ** 
     29**                                                                    **
     30***********************************************************************/
     31
     32
    133#include <iostream>
    234#include <utility>
  • trunk/src/LHEFConverter.cc

    r246 r264  
     1/***********************************************************************
     2**                                                                    **
     3**          /----------------------------------------------\          **
     4**         |  Delphes, a framework for the fast simulation  |         **
     5**         |       of a  generic collider experiment        |         **
     6**          \----------------------------------------------/          **
     7**                                                                    **
     8**                                                                    **
     9**   This package uses:                                               **
     10**   ------------------                                               **
     11**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     12**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     13**   FROG: [hep-ex/0901.2718v1]                                       **
     14**                                                                    **
     15** ------------------------------------------------------------------ **
     16**                                                                    **
     17**   Main authors:                                                    **
     18**   -------------                                                    **
     19**                                                                    **
     20**                Severine Ovyn                Xavier Rouby           **
     21**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     22**                                                                    **
     23**         Center for Particle Physics and Phenomenology (CP3)        **
     24**                Universite catholique de Louvain (UCL)              **       
     25**                     Louvain-la-Neuve, Belgium                      **           
     26**                                                                    **
     27**                      Copyright (C) 2008-2009,                      **
     28**                        All rights reserved.                        ** 
     29**                                                                    **
     30***********************************************************************/
     31
     32
    133#include <iostream>
    234#include <fstream>
  • trunk/src/STDHEPConverter.cc

    r245 r264  
    1 /*
    2   ---- Delphes ----
    3   A Fast Simulator for general purpose LHC detector
    4   S. Ovyn ~~~~ severine.ovyn@uclouvain.be
    5 
    6   Center for Particle Physics and Phenomenology (CP3)
    7   Universite Catholique de Louvain (UCL)
    8   Louvain-la-Neuve, Belgium
    9 */
     1/***********************************************************************
     2**                                                                    **
     3**          /----------------------------------------------\          **
     4**         |  Delphes, a framework for the fast simulation  |         **
     5**         |       of a  generic collider experiment        |         **
     6**          \----------------------------------------------/          **
     7**                                                                    **
     8**                                                                    **
     9**   This package uses:                                               **
     10**   ------------------                                               **
     11**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     12**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     13**   FROG: [hep-ex/0901.2718v1]                                       **
     14**                                                                    **
     15** ------------------------------------------------------------------ **
     16**                                                                    **
     17**   Main authors:                                                    **
     18**   -------------                                                    **
     19**                                                                    **
     20**                Severine Ovyn                Xavier Rouby           **
     21**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     22**                                                                    **
     23**         Center for Particle Physics and Phenomenology (CP3)        **
     24**                Universite catholique de Louvain (UCL)              **       
     25**                     Louvain-la-Neuve, Belgium                      **           
     26**                                                                    **
     27**                      Copyright (C) 2008-2009,                      **
     28**                        All rights reserved.                        ** 
     29**                                                                    **
     30***********************************************************************/
     31
    1032
    1133#include <iostream>
  • trunk/src/SmearUtil.cc

    r261 r264  
    3030***********************************************************************/
    3131
     32
    3233/// \file SmearUtil.cc
    3334/// \brief RESOLution class, and some generic definitions
     
    4243#include <iomanip>
    4344using namespace std;
    44 
    45 
    46 ParticleUtil::ParticleUtil(const TLorentzVector &genMomentum, int pid) {
    47   _pid=pid;
    48   _e = genMomentum.E();
    49   _px = genMomentum.Px();
    50   _py = genMomentum.Py();
    51   _pz = genMomentum.Pz();
    52   _pt = genMomentum.Pt();
    53 
    54   //_e, _px, _py, _pz, _pt;
    55   //float _eta, _etaCalo, _phi, _phiCalo;
    56   //int _pid;
    57 }
    5845
    5946//------------------------------------------------------------------------------
     
    7865  // Energy resolution for hadrons in ecal/hcal/hf
    7966  // \sigma/E = C + N/E + S/\sqrt{E}
    80   HAD_Shcal         = 1.5;               // S term for central HCAL 
     67  HAD_Shcal         = 1.5;               // S term for central HCAL
    8168  HAD_Nhcal         = 0.;                // N term for central HCAL
    8269  HAD_Chcal         = 0.05;              // C term for central HCAL
    83   HAD_Shf           = 2.7;               // S term for FCAL
     70  HAD_Shf           = 2.7;               // S term for FCAL 
    8471  HAD_Nhf           = 0.;                // N term for FCAL
    8572  HAD_Chf           = 0.13;              // C term for FCAL
     
    128115  FLAG_bfield      = 1;                       //1 to run the bfield propagation else 0
    129116  FLAG_vfd         = 1;                       //1 to run the very forward detectors else 0
     117  FLAG_zdc         = 1;                       //1 to run the zero degree calorimeter else 0
    130118  FLAG_trigger     = 1;                       //1 to run the trigger selection else 0
    131119  FLAG_frog        = 1;                       //1 to run the FROG event display
     
    186174  RP_cross_y        = 0.0;
    187175  RP_cross_ang      = 142.5;
    188 
    189 
    190176 
    191177}
     
    250236  FLAG_bfield      = DET.FLAG_bfield;
    251237  FLAG_vfd         = DET.FLAG_vfd;
     238  FLAG_zdc         = DET.FLAG_zdc;
    252239  FLAG_trigger     = DET.FLAG_trigger;
    253240  FLAG_frog        = DET.FLAG_frog;
     
    279266  RP_IP_name        = DET.RP_IP_name;
    280267
    281 
    282268  // In case FROG event display allowed
    283269  NEvents_Frog      = DET.NEvents_Frog;
     
    364350  FLAG_bfield      = DET.FLAG_bfield;
    365351  FLAG_vfd         = DET.FLAG_vfd;
     352  FLAG_zdc         = DET.FLAG_zdc;
    366353  FLAG_trigger     = DET.FLAG_trigger;
    367354  FLAG_frog        = DET.FLAG_frog;
     
    504491
    505492    else if(strstr(temp_string.c_str(),"FLAG_vfd"))         {curstring >> varname >> ivalue; FLAG_vfd         = ivalue;}
     493    else if(strstr(temp_string.c_str(),"FLAG_zdc"))         {curstring >> varname >> ivalue; FLAG_zdc         = ivalue;}
    506494    else if(strstr(temp_string.c_str(),"FLAG_trigger"))     {curstring >> varname >> ivalue; FLAG_trigger     = ivalue;}
    507495    else if(strstr(temp_string.c_str(),"FLAG_frog"))        {curstring >> varname >> ivalue; FLAG_frog        = ivalue;}
     
    604592  if(FLAG_vfd==1){
    605593    f_out<<"#**********************************                                  *"<<"\n";
    606     f_out<<"# Very forward detector switches on                                  *"<<"\n";
     594    f_out<<"# Very forward detector switched on                                  *"<<"\n";
    607595    f_out<<"#**********************************                                  *"<<"\n";
    608596    f_out<<"*                                                                    *"<<"\n";
     
    639627    f_out << left << setw(44) <<"* Angle of  beam crossing:"<<""
    640628          << left << setw(6) <<RP_cross_ang           <<""<< right << setw(20)<<"! not in datacard  *"<<"\n";
    641 
    642629    f_out<<"*                                                                    *"<<"\n";
    643630  }
    644631  else {
    645632    f_out<<"#***********************************                                 *"<<"\n";
    646     f_out<<"# Very forward detector switches off                                 *"<<"\n";
     633    f_out<<"# Very forward detector switched off                                 *"<<"\n";
    647634    f_out<<"#***********************************                                 *"<<"\n";
    648635    f_out<<"*                                                                    *"<<"\n";
     
    692679  if(FLAG_bfield==1){
    693680    f_out<<"#***************************                                         *"<<"\n";
    694     f_out<<"# Magnetic field switches on                                         *"<<"\n";
     681    f_out<<"# Magnetic field switched on                                         *"<<"\n";
    695682    f_out<<"#***************************                                         *"<<"\n";
    696683    f_out<<"*                                                                    *"<<"\n";
     
    713700  else {
    714701    f_out<<"#****************************                                        *"<<"\n";
    715     f_out<<"# Magnetic field switches off                                        *"<<"\n";
     702    f_out<<"# Magnetic field switched off                                        *"<<"\n";
    716703    f_out<<"#****************************                                        *"<<"\n";
    717704    f_out << left << setw(55) <<"* Minimal pT needed to reach the calorimeter [GeV]: "<<""
     
    953940//******************************************************************************************
    954941
    955 void RESOLution::SortedVector(vector<ParticleUtil> &vect)
     942//void RESOLution::SortedVector(vector<ParticleUtil> &vect)
     943void RESOLution::SortedVector(vector<D_Particle> &vect)
    956944{
    957945  int i,j = 0;
     
    966954          if ( vect[j].Pt() > vect[j-1].Pt() )
    967955             {
    968                ParticleUtil tmp = vect[j-1];
     956               //ParticleUtil tmp = vect[j-1];
     957               D_Particle tmp = vect[j-1];
    969958               vect[j-1] = vect[j];
    970959               vect[j] = tmp;
     
    10621051  //********** returns a segmented value for eta and phi, for calo towers *****
    10631052void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){
    1064    iEta = -100;
    1065    int index=-100;
     1053   iEta = UNDEFINED;
     1054   int index= iUNDEFINED;
    10661055   for (unsigned int i=1; i< TOWER_number+1; i++) {
    10671056        if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) {
     
    10721061        }
    10731062   }
    1074    if(index==-100) return;
    1075    iPhi = -100;
     1063   if(index==UNDEFINED) return;
     1064   iPhi = UNDEFINED;
    10761065   float dphi = TOWER_dphi[index]*pi/180.;
    10771066   for (unsigned int i=1; i < 360/TOWER_dphi[index]; i++ ) {
     
    10851074   if (phi > pi-dphi) iPhi = pi-dphi;
    10861075}
     1076
     1077
    10871078
    10881079//**************************** Returns the delta Phi ****************************
  • trunk/src/TreeClasses.cc

    r219 r264  
     1/***********************************************************************
     2**                                                                    **
     3**          /----------------------------------------------\          **
     4**         |  Delphes, a framework for the fast simulation  |         **
     5**         |       of a  generic collider experiment        |         **
     6**          \----------------------------------------------/          **
     7**                                                                    **
     8**                                                                    **
     9**   This package uses:                                               **
     10**   ------------------                                               **
     11**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     12**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     13**   FROG: [hep-ex/0901.2718v1]                                       **
     14**                                                                    **
     15** ------------------------------------------------------------------ **
     16**                                                                    **
     17**   Main authors:                                                    **
     18**   -------------                                                    **
     19**                                                                    **
     20**                Severine Ovyn                Xavier Rouby           **
     21**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     22**                                                                    **
     23**         Center for Particle Physics and Phenomenology (CP3)        **
     24**                Universite catholique de Louvain (UCL)              **       
     25**                     Louvain-la-Neuve, Belgium                      **           
     26**                                                                    **
     27**                      Copyright (C) 2008-2009,                      **
     28**                        All rights reserved.                        ** 
     29**                                                                    **
     30***********************************************************************/
     31
     32
    133#include "TreeClasses.h"
    234
  • trunk/src/TreeClassesLinkDef.h

    r219 r264  
     1/***********************************************************************
     2**                                                                    **
     3**          /----------------------------------------------\          **
     4**         |  Delphes, a framework for the fast simulation  |         **
     5**         |       of a  generic collider experiment        |         **
     6**          \----------------------------------------------/          **
     7**                                                                    **
     8**                                                                    **
     9**   This package uses:                                               **
     10**   ------------------                                               **
     11**   FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210]      **
     12**   Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2]       **
     13**   FROG: [hep-ex/0901.2718v1]                                       **
     14**                                                                    **
     15** ------------------------------------------------------------------ **
     16**                                                                    **
     17**   Main authors:                                                    **
     18**   -------------                                                    **
     19**                                                                    **
     20**                Severine Ovyn                Xavier Rouby           **
     21**          severine.ovyn@uclouvain.be      xavier.rouby@cern         **
     22**                                                                    **
     23**         Center for Particle Physics and Phenomenology (CP3)        **
     24**                Universite catholique de Louvain (UCL)              **       
     25**                     Louvain-la-Neuve, Belgium                      **           
     26**                                                                    **
     27**                      Copyright (C) 2008-2009,                      **
     28**                        All rights reserved.                        ** 
     29**                                                                    **
     30***********************************************************************/
     31
     32
    133#include "interface/TreeClasses.h"
    234
  • trunk/src/TriggerUtil.cc

    r260 r264  
    132132
    133133//*************************************************************************
     134TriggerBit::TriggerBit() {
     135}
    134136
    135137TriggerBit::~TriggerBit() {
     
    143145        EtmisValues.clear();
    144146        GammaValues.clear();
    145 
    146147}
    147148
     
    153154        IElecValues.push_back(tb.IElecValues[i]);
    154155
    155 
    156156  for(unsigned int i=0; i<tb.MuonValues.size(); i++)
    157157        MuonValues.push_back(tb.MuonValues[i]);
     
    165165  for(unsigned int i=0; i<tb.BjetValues.size(); i++)
    166166        BjetValues.push_back(tb.BjetValues[i]);
    167 
    168167
    169168  for(unsigned int i=0; i<tb.TauJetValues.size(); i++)
     
    218217      TClonesArray *branchPhotonTrig,  TClonesArray *branchETmisTrig)
    219218{
    220 
    221219  TSimpleArray<TRootJet> bjets=SubArrayBjets(branchJetTrig);
    222220  TSimpleArray<TRootElectron> Ielectron=SubArrayIElec(branchElecTrig);
    223221  TSimpleArray<TRootMuon> Imuon=SubArrayIMuon(branchMuonTrig);
    224  
     222
    225223  int elec_size = ElecValues.size();
    226224  int Ielec_size = IElecValues.size();
     
    263261        }
    264262
    265 
    266263      if(muon_size!=0){
    267264        TRootMuon *muon;
     
    287284           if(jet->PT < JetValues[i])Result=false;}}
    288285
    289       if(jet_size!=0){
    290         TRootJet *jet;
    291         for(int i=0;i<jet_size;i++){
    292            jet = (TRootJet*)branchJetTrig->At(i);
    293            if(jet->PT < JetValues[i])Result=false;}}
    294 
    295286      if(bjet_size!=0)
    296287        {
     
    304295        }
    305296
    306 
    307297      if(taujet_size!=0){
    308298        TRootTauJet *taujet;
     
    338328  vector<string> BjetSequences;
    339329
    340 ///  char *result =NULL;
    341330  char * result = new char[256];
    342331  result = strtok( (char*) trigger_algorithm.c_str(),"&");
     
    354343       result = strtok( NULL,"&");
    355344     }
    356   delete result;
     345  delete [] result;
    357346
    358347  ElecValues = GetCuts(ElecSequences);
     
    368357}
    369358
     359
    370360void TriggerBit::PrintTrigCondition(const string& LogName,const int i)
    371361{
     
    379369  int etmis_size = TriggerBit::EtmisValues.size();
    380370  int bjets_size = TriggerBit::BjetValues.size();
    381  
     371
    382372  ofstream f_out(LogName.c_str(),ios::app);
    383373
     
    439429   }
    440430  return OrderedValue;
     431
    441432}
    442433
     
    480471}
    481472
    482 
Note: See TracChangeset for help on using the changeset viewer.