Fork me on GitHub

Changeset 267 in svn for trunk


Ignore:
Timestamp:
Feb 13, 2009, 8:38:04 PM (16 years ago)
Author:
severine ovyn
Message:

remove double

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Delphes.cpp

    r264 r267  
    7777int main(int argc, char *argv[])
    7878{
    79 unsigned int nnnn=0, mmmm=0;
    8079
    8180  int appargc = 2;
     
    292291  //Output file : contents of the analysis object data
    293292  ExRootTreeWriter *treeWriter = new ExRootTreeWriter(outputfilename, "Analysis");
     293  ExRootTreeBranch *branchTauJet = treeWriter->NewBranch("TauJet", TRootTauJet::Class());
    294294  ExRootTreeBranch *branchJet = treeWriter->NewBranch("Jet", TRootJet::Class());
    295   ExRootTreeBranch *branchTauJet = treeWriter->NewBranch("TauJet", TRootTauJet::Class());
    296295  ExRootTreeBranch *branchElectron = treeWriter->NewBranch("Electron", TRootElectron::Class());
    297296  ExRootTreeBranch *branchMuon = treeWriter->NewBranch("Muon", TRootMuon::Class());
     
    380379      input_particles.clear();
    381380
    382 
    383 /*
    384 if(0) { // OLD SMEARING ALGORITHM without energy flow
    385       // 2.1 Loop over all particles in event
    386       itGen.Reset();
    387       while( (particle = (TRootGenParticle*) itGen.Next()) ) {
    388           int pid = abs(particle->PID);
    389           float iPhi=0,iEta=0;
    390 
    391        
    392           // 2.1.1********************* preparation for the b-tagging
    393           //// This subarray is needed for the B-jet algorithm
    394           // optimization for speed : put first PID condition, then ETA condition, then either pt or status
    395           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 ?
    396               fabs(particle->Eta) < DET->CEN_max_tracker &&
    397               particle->Status != 1 &&
    398               particle->PT > DET->PT_QUARKS_MIN ) {
    399             NFCentralQ.Add(particle);
    400           }
    401          
    402           // 2.1.2 ********************* central detector: keep only visible particles
    403           // keeps only final particles, visible by the central detector, including the fiducial volume
    404           // the ordering of conditions have been optimised for speed : put first the STATUS condition
    405           if( (particle->Status == 1)    &&
    406               (pid != pNU1) && (pid != pNU2) && (pid != pNU3) &&
    407               (fabs(particle->Eta) < DET->CEN_max_calo_fwd)
    408               )
    409             {
    410               genMomentum.SetPxPyPzE(particle->Px, particle->Py, particle->Pz, particle->E);
    411               genMomentumBfield = genMomentum;
    412 
    413               // 2.1.2.1 ********************* central detector: magnetic field
    414               // genMomentumBfield is then changed with respect to the magnetic field
    415               if(DET->FLAG_bfield==1)  TRACP->Propagation(particle,genMomentumBfield);
    416               float eta=fabs(genMomentumBfield.Eta());
    417              
    418  
    419               // 2.1.2.2 ********************* central detector: smearing (calorimeters, muon chambers)
    420               switch(pid) {
    421                
    422               case pE: // all electrons with eta < DET->MAX_CALO_FWD
    423                 DET->SmearElectron(genMomentumBfield);
    424                 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_elec){
    425                   electron.push_back(ParticleUtil(genMomentumBfield,particle->PID));
    426                 }
    427                 break; // case pE
    428               case pGAMMA: // all photons with eta < DET->MAX_CALO_FWD
    429                 DET->SmearElectron(genMomentumBfield);
    430                 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_tracker && genMomentumBfield.Pt() > DET->PTCUT_gamma) {
    431                   gamma.push_back(ParticleUtil(genMomentumBfield,particle->PID));
    432                 }
    433                 break; // case pGAMMA
    434               case pMU: // all muons with eta < DET->MAX_MU
    435                 DET->SmearMu(genMomentumBfield);
    436                 if(genMomentumBfield.E()!=0 && eta < DET->CEN_max_mu &&  genMomentumBfield.Pt() > DET->PTCUT_muon){
    437                   muon.push_back(ParticleUtil(genMomentumBfield,particle->PID));
    438                 }
    439                 break; // case pMU
    440               case pLAMBDA: // all lambdas with eta < DET->MAX_CALO_FWD
    441               case pK0S:    // all K0s with eta < DET->MAX_CALO_FWD
    442                 DET->SmearHadron(genMomentumBfield, 0.7);
    443                 break; // case hadron
    444               default:   // all other final particles with eta < DET->MAX_CALO_FWD
    445                 DET->SmearHadron(genMomentumBfield, 1.0);
    446                 break;
    447               } // 2.1.2.2  switch (pid)
    448              
    449  
    450               // 2.1.2.3 ********************* central detector: calotowers
    451               // all final particles but muons and neutrinos   
    452               // for calorimetric towers and missing PT
    453               int charge=Charge(pid);
    454               if(genMomentumBfield.E() !=0 && pid != pMU) {
    455                 // in case the Bfield is not simulated, checks that charged particles have enough pt to reach the calos
    456                 if ( !DET->FLAG_bfield && charge!=0 && genMomentumBfield.Pt() <= DET->TRACK_ptmin ) {}// particules do not reach calos
    457                 else { // particles reach calos
    458                   // applies the calo segmentation and returns iEta & iPhi
    459                   DET->BinEtaPhi(genMomentumBfield.Phi(), genMomentumBfield.Eta(), iPhi, iEta);
    460                   if(iEta != UNDEFINED && iPhi != UNDEFINED) {
    461                       momentumCaloSegmentation.SetPtEtaPhiE(genMomentumBfield.Pt(),iEta,iPhi,genMomentumBfield.E());
    462                       elementCalo = (TRootCalo*) branchCalo->NewEntry();
    463                       elementCalo->Set(momentumCaloSegmentation);
    464                       PhysicsTower Tower(LorentzVector(momentumCaloSegmentation.Px(),momentumCaloSegmentation.Py(),momentumCaloSegmentation.Pz(),momentumCaloSegmentation.E()));
    465                       towers.push_back(Tower);
    466                   } // if iEta != UNDEFINED
    467                 } // else : when particles reach the calos
    468               } // 2.1.2.3 calotowers
    469 
    470 
    471               // 2.1.2.4 ********************* central detector: tracks
    472               // all final charged particles
    473               if(
    474                  (genMomentumBfield.E()!=0) &&
    475                  (fabs(genMomentumBfield.Eta()) < DET->CEN_max_tracker) &&
    476                  (DET->FLAG_bfield || ( !DET->FLAG_bfield && genMomentum.Pt() > DET->TRACK_ptmin )) &&     
    477                         // if bfield not simulated, pt should be high enough to be taken into account
    478                  ((rand()%100) < DET->TRACK_eff)  &&
    479                  (charge!=0)
    480                  )
    481                 {
    482                   elementTracks = (TRootTracks*) branchTracks->NewEntry();
    483                   elementTracks->Set(genMomentum); // fills px,py,pz,pt,e,eta,phi at vertex
    484                   elementTracks->Etaout = genMomentumBfield.Eta();
    485                   elementTracks->Phiout = genMomentumBfield.Phi();
    486                   // TODO!!! apply a smearing on the position of the origin of the track
    487                   // elementTracks->SetPosition(particle->X,particle->Y,particle->Z);
    488                   // uses the output of the bfield computation : Xout=... Yout=... Zout...
    489                   // TODO!!! elementTrakcs->SetPositionOut(Xout,Yout,Zout);
    490                   TrackCentral.push_back(genMomentum); // tracks at vertex!
    491                 } // 2.1.2.4 tracks
    492              
    493             } // 2.1.2 central detector
    494          
    495           // 2.1.3 ********************* forward detectors: zdc
    496           if(DET->FLAG_vfd==1) {
    497              VFD->ZDC(treeWriter,branchZDC,particle);
    498              VFD->RomanPots(treeWriter,branchRP220,branchFP420,particle);
    499           }
    500 } // IF OLD ALGORITHM (= no energy flow )
    501 
    502 
    503 
    504 
    505 else // IF NEW ALGORITHM with energy flow             
    506 */
    507 {
     381      {
    508382      D_CaloTowerList list_of_active_towers;
    509383      D_CaloTowerList list_of_towers_with_photon; // to speed up the code: will only look in interesting towers for gamma candidates
     
    533407            // 2.1a.2.1 Central solenoidal magnetic field
    534408            TRACP->bfield(particle); // fills in particle->EtaCalo et particle->PhiCalo
    535             particle->SetEtaPhi(particle->EtaCalo,particle->PhiCalo); // ???? check this line
    536409
    537410            // 2.1a.2.2 Filling the calorimetric towers -- includes also forward detectors ?
  • trunk/Utilities/ExRootAnalysis/interface/BlockClasses.h

    r264 r267  
    1313 *  present in the data members of the Block TRoot class.
    1414 *
    15  *  $Date: 2009-02-11 09:19:14 $
    16  *  $Revision: 1.12 $
     15 *  $Date: 2009-02-13 19:38:03 $
     16 *  $Revision: 1.13 $
    1717 *
    1818 * 
     
    312312*/
    313313
    314 //class TRootCalo: public TSortableObject {
    315 class TRootCalo: public TRootParticle {
     314class TRootCalo: public TSortableObject
     315{
     316//class TRootCalo: public TRootParticle {
    316317 public:
     318   float Eta;
     319   float Phi;
     320   float E;
    317321   TRootCalo() ;
    318322   TRootCalo(const TRootCalo& cal);
     
    320324   void set(const D_CaloTower&  cal);
    321325   static TCompare *fgCompare; //!
    322  //  const TCompare *GetCompare() const { return fgCompare; }
     326   const TCompare *GetCompare() const { return fgCompare; }
    323327   const float getET() const {return ET;}
    324328 
     
    345349//---------------------------------------------------------------------------
    346350
    347 class TRootJet: public TRootParticle
     351class TRootTauJet: public TSortableObject
     352{
     353public:
     354  TRootTauJet() {};
     355
     356  float E;  // particle energy in GeV
     357  float Px; // particle momentum vector (x component) in GeV
     358  float Py; // particle momentum vector (y component) in GeV
     359  float Pz; // particle momentum vector (z component) in GeV
     360
     361  float Eta; // particle pseudorapidity 
     362  float Phi; // particle azimuthal angle in rad
     363
     364  void Set(const TLorentzVector& momentum);// { return TRootParticle::Set(momentum); }
     365
     366  static TCompare *fgCompare; //!
     367  const TCompare *GetCompare() const { return fgCompare; }
     368 
     369  float PT; // particle transverse momentum in GeV
     370
     371  ClassDef(TRootTauJet, 1)
     372};
     373
     374//---------------------------------------------------------------------------
     375
     376class TRootJet: public TRootTauJet
    348377{
    349378public:
    350379  TRootJet() {};
     380
     381  static TCompare *fgCompare; //!
     382
    351383  bool Btag;
    352384
    353   static TCompare *fgCompare; //!
    354  
    355385  ClassDef(TRootJet, 1)
    356386};
    357387
    358 //---------------------------------------------------------------------------
    359 
    360 class TRootTauJet: public TRootParticle
    361 {
    362 public:
    363   TRootTauJet() {};
    364   static TCompare *fgCompare; //!
    365 
    366   ClassDef(TRootTauJet, 1)
    367 };
     388//------------------------------------------------------------------------------
    368389
    369390class TRootTrigger: public TSortableObject
  • trunk/Utilities/ExRootAnalysis/src/BlockClasses.cc

    r264 r267  
    1111 *  to preserve mother-dautherlinks between particles.
    1212 *
    13  *  $Date: 2009-02-11 09:19:14 $
    14  *  $Revision: 1.8 $
     13 *  $Date: 2009-02-13 19:38:03 $
     14 *  $Revision: 1.9 $
    1515 *
    1616 * 
     
    2525
    2626TCompare *TRootGenParticle::fgCompare = 0;
    27 TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
    2827TCompare *TRootElectron::fgCompare = TComparePT<TRootElectron>::Instance();
    2928TCompare *TRootMuon::fgCompare = TComparePT<TRootMuon>::Instance();
    3029TCompare *TRootPhoton::fgCompare = TComparePT<TRootPhoton>::Instance();
    3130TCompare *TRootTauJet::fgCompare = TComparePT<TRootTauJet>::Instance();
     31TCompare *TRootJet::fgCompare = TComparePT<TRootJet>::Instance();
    3232TCompare *TRootTracks::fgCompare = TComparePT<TRootTracks>::Instance();
    3333TCompare *TRootETmis::fgCompare = 0;
     
    5050        Eta = momentum.Eta();
    5151        Phi = momentum.Phi();
     52}
     53
     54void TRootTauJet::Set(const TLorentzVector& momentum) {
     55
     56        E   = momentum.E();
     57        Px  = momentum.Px();
     58        Py  = momentum.Py();
     59        Pz  = momentum.Pz();
     60        PT  = momentum.Pt();
     61        Eta = momentum.Eta();
     62        Phi = momentum.Phi();
     63
    5264}
    5365
     
    150162        E_em=cal.getEem(); E_had=cal.getEhad();
    151163        E   =cal.getE();   ET   =cal.getET();
    152         EtaCalo = cal.getEta();
    153         PhiCalo = cal.getPhi();
     164        //EtaCalo = cal.getEta();
     165        //PhiCalo = cal.getPhi();
    154166}
    155167
  • trunk/Utilities/ExRootAnalysis/src/BlockClassesLinkDef.h

    r264 r267  
    44 *  Lists classes to be included in cint dicitonary
    55 *
    6  *  $Date: 2009-02-11 09:19:14 $
    7  *  $Revision: 1.3 $
     6 *  $Date: 2009-02-13 19:38:03 $
     7 *  $Revision: 1.4 $
    88 *
    99 * 
     
    2424#pragma link C++ class TRootSelectorInfo;
    2525#pragma link C++ class TRootGenParticle;
    26 #pragma link C++ class TRootJet;
    2726#pragma link C++ class TRootElectron;
    2827#pragma link C++ class TRootMuon;
    2928#pragma link C++ class TRootPhoton;
    3029#pragma link C++ class TRootTauJet;
     30#pragma link C++ class TRootJet;
    3131#pragma link C++ class TRootTracks;
    3232#pragma link C++ class TRootETmis;
Note: See TracChangeset for help on using the changeset viewer.