]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Allow only generated particles by MC generator and not MC transport particles to...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Dec 2010 09:33:15 +0000 (09:33 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Dec 2010 09:33:15 +0000 (09:33 +0000)
In case of MC particles analysis, PID should set electrons and photons distinctly in EMCAL

PWG4/PartCorrBase/AliCaloPID.cxx
PWG4/PartCorrBase/AliCaloTrackMCReader.cxx
PWG4/PartCorrBase/AliCaloTrackMCReader.h

index 49c5b7b5cfd388b3c04b0f621c50f1f276797d8d..0c285f3410a1cb8414662e0678017a0a20ca8821 100755 (executable)
@@ -186,17 +186,17 @@ void AliCaloPID::InitParameters()
 {
   //Initialize the parameters of the PID.
   
-  fEMCALPhotonWeight   = 0.5 ;
-  fEMCALPi0Weight      = 0.5 ;
-  fEMCALElectronWeight = 0.5 ;
-  fEMCALChargeWeight   = 0.5 ;
-  fEMCALNeutralWeight  = 0.5 ;
-  
-  fPHOSPhotonWeight    = 0.5 ;
-  fPHOSPi0Weight       = 0.5 ;
-  fPHOSElectronWeight  = 0.5 ;
-  fPHOSChargeWeight    = 0.5 ;
-  fPHOSNeutralWeight   = 0.5 ;
+  fEMCALPhotonWeight   = 0.6 ;
+  fEMCALPi0Weight      = 0.6 ;
+  fEMCALElectronWeight = 0.6 ;
+  fEMCALChargeWeight   = 0.6 ;
+  fEMCALNeutralWeight  = 0.6 ;
+  
+  fPHOSPhotonWeight    = 0.6 ;
+  fPHOSPi0Weight       = 0.6 ;
+  fPHOSElectronWeight  = 0.6 ;
+  fPHOSChargeWeight    = 0.6 ;
+  fPHOSNeutralWeight   = 0.6 ;
   
   //Formula to set the PID weight threshold for photon or pi0
   //fPHOSWeightFormula = kTRUE;
@@ -281,15 +281,14 @@ Int_t AliCaloPID::GetPdg(const TString calo, const Double_t * pid, const Float_t
       pdg = kNeutralUnknown ;
   }
   else{//EMCAL
-
-    if(pid[AliVCluster::kPhoton]+pid[AliVCluster::kElectron]  > wPh) pdg = kPhoton ; //temporal sollution until track matching for electrons is considered
-    //if(pid[AliVCluster::kPhoton]  > wPh) pdg = kPhoton ;
-    else if(pid[AliVCluster::kPi0] > wPi0) pdg = kPi0 ; 
-    //else if(pid[AliVCluster::kElectron]  > wE) pdg = kElectron ;
+    
+    if(pid[AliVCluster::kPhoton]  > wPh)                     pdg = kPhoton ;
+    else if(pid[AliVCluster::kElectron]  > wE)               pdg = kElectron ;
+    else if(pid[AliVCluster::kPhoton]+pid[AliVCluster::kElectron]  > wPh) pdg = kPhoton ; //temporal sollution until track matching for electrons is considered
+    else if(pid[AliVCluster::kPi0] > wPi0)                   pdg = kPi0 ; 
     else if(chargedHadronWeight + neutralHadronWeight > wCh) pdg = kChargedHadron ;  
     else if(neutralHadronWeight + chargedHadronWeight > wNe) pdg = kNeutralHadron ; 
-    else pdg =  kNeutralUnknown ;
-    
+    else                                                     pdg = kNeutralUnknown ;
   }
   
   if(fDebug > 0)printf("AliCaloPID::GetPdg:Final Pdg: %d, cluster energy %2.2f \n", pdg,energy);
index aa59ae822bc2ad61aeaf0f31eb3f5ebb4aec056d..cdb4c0b3ac00321371b2ced815ef3bc54fc53fe8 100755 (executable)
@@ -19,6 +19,8 @@
 // or other particle identification and correlations
 // Separates generated particles into charged (CTS) 
 // and neutral (PHOS or EMCAL acceptance)
+// Now, it only works with data stored in Kinematics.root and 
+// not in filtered Kinematics branch in AODs
 //
 //*-- Author: Gustavo Conesa (LNF-INFN) 
 //////////////////////////////////////////////////////////////////////////////
@@ -50,7 +52,8 @@ AliCaloTrackMCReader::AliCaloTrackMCReader() :
   AliCaloTrackReader(), fDecayPi0(0), 
   fNeutralParticlesArray(0x0), fChargedParticlesArray(0x0), 
   fStatusArray(0x0), fKeepAllStatus(0), fCheckOverlap(0),  
-  fEMCALOverlapAngle(0),fPHOSOverlapAngle(0), fIndex2ndPhoton(0)
+  fEMCALOverlapAngle(0),fPHOSOverlapAngle(0), fIndex2ndPhoton(0),
+  fOnlyGeneratorParticles(kTRUE)
 {
   //Ctor
   
@@ -63,7 +66,7 @@ AliCaloTrackMCReader::~AliCaloTrackMCReader() {
 
   if(fChargedParticlesArray) delete fChargedParticlesArray ;
   if(fNeutralParticlesArray) delete fNeutralParticlesArray ;
-  if(fStatusArray) delete fStatusArray ;
+  if(fStatusArray)           delete fStatusArray ;
 
 }
 
@@ -95,22 +98,23 @@ void AliCaloTrackMCReader::InitParameters()
   fNeutralParticlesArray->SetAt(12,0); fNeutralParticlesArray->SetAt(14,1); fNeutralParticlesArray->SetAt(16,2); 
   fStatusArray = new TArrayI(1);
   fStatusArray->SetAt(1,0); 
-  fKeepAllStatus = kTRUE;
+  
+  fOnlyGeneratorParticles = kTRUE;
+  fKeepAllStatus          = kTRUE;
 
-  fCheckOverlap = kFALSE;
-  fEMCALOverlapAngle = 2.5 * TMath::DegToRad();
-  fPHOSOverlapAngle = 0.5 * TMath::DegToRad();
-  fIndex2ndPhoton = -1;
+  fCheckOverlap       = kFALSE;
+  fEMCALOverlapAngle  = 2.5 * TMath::DegToRad();
+  fPHOSOverlapAngle   = 0.5 * TMath::DegToRad();
+  fIndex2ndPhoton     = -1;
   
-  fDataType = kMC;  
+  fDataType           = kMC;  
   fReadStack          = kTRUE;
-  fReadAODMCParticles = kFALSE;
+  fReadAODMCParticles = kFALSE; //This class only works with Kinematics.root input.
   
   //For this reader we own the objects of the arrays
-  fAODCTS->SetOwner(kTRUE); 
+  fAODCTS  ->SetOwner(kTRUE); 
   fAODEMCAL->SetOwner(kTRUE); 
-  fAODPHOS->SetOwner(kTRUE); 
+  fAODPHOS ->SetOwner(kTRUE); 
   
 }
 
@@ -211,9 +215,9 @@ void  AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* parti
 Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * currentFileName){
   //Fill the event counter and input lists that are needed, called by the analysis maker.
   
-  fEventNumber = iEntry;
+  fEventNumber     = iEntry;
   fCurrentFileName = TString(currentFileName);
-  fTrackMult = 0;
+  fTrackMult       = 0;
   //In case of analysis of events with jets, skip those with jet pt > 5 pt hard        
   if(fComparePtHardAndJetPt && GetStack()) {
     if(!ComparePtHardAndJetPt()) return kFALSE ;
@@ -222,10 +226,11 @@ Bool_t AliCaloTrackMCReader::FillInputEvent(const Int_t iEntry, const char * cur
   //Fill Vertex array
   FillVertexArray();
   
-  Int_t iParticle = 0 ;
-  Double_t charge = 0.;
-       
-  for (iParticle = 0 ; iParticle <  GetStack()->GetNtrack() ; iParticle++) {
+  Int_t iParticle  = 0 ;
+  Double_t charge  = 0.;
+  Int_t nparticles = GetStack()->GetNtrack() ;
+  if(fOnlyGeneratorParticles) nparticles=GetStack()->GetNprimary();
+  for (iParticle = 0 ; iParticle <  nparticles ; iParticle++) {
     TParticle * particle = GetStack()->Particle(iParticle);
     TLorentzVector momentum;
     Float_t p[3];
index e6d388c16c6debf82322bbc5bdd2d1ad0848d3ae..a6f8bfc68363686a8a532a0905582adfae2a66f9 100755 (executable)
@@ -10,6 +10,9 @@
 // Separates generated particles into charged (CTS) 
 // and neutral (PHOS or EMCAL acceptance)
 //
+// Now, it only works with data stored in Kinematics.root and 
+// not in filtered Kinematics branch in AODs
+//
 //*-- Author: Gustavo Conesa (LNF-INFN) 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -63,6 +66,9 @@ public:
   void SwitchOffStatusSelection() {fKeepAllStatus = kTRUE;}
   Bool_t KeepParticleWithStatus(Int_t status) const ;
   
+  void SwitchOnOnlyGeneratorParticles()  {fOnlyGeneratorParticles = kTRUE;}
+  void SwitchOffOnlyGeneratorParticles() {fOnlyGeneratorParticles = kFALSE;}
+  
   void GetVertex(Double_t v[3]) const ;
   Double_t* GetVertex(const Int_t evtIndex) const {return fVertex[evtIndex];}
   void GetVertex(Double_t vertex[3], const Int_t evtIndex) const 
@@ -82,7 +88,7 @@ public:
   Float_t GetPHOSOverlapAngle() const {return fPHOSOverlapAngle ;}
   void SetEMCALOverlapAngle(Float_t angle)  {fEMCALOverlapAngle = angle;}
   void SetPHOSOverlapAngle(Float_t angle) {fPHOSOverlapAngle = angle;}
-
+  
   AliESDCentrality* GetCentrality() const {return 0x0;}
   
  private:
@@ -101,8 +107,9 @@ public:
   Float_t   fEMCALOverlapAngle;      // Aperture angle of photons from decay that is not resolved by EMCAL, in radians
   Float_t   fPHOSOverlapAngle;       // Aperture angle of photons from decay that is not resolved by PHOS, in radians
   Int_t     fIndex2ndPhoton;         // Check overlap of first decay photon already done, internal use.
-
-  ClassDef(AliCaloTrackMCReader,3)
+  Bool_t    fOnlyGeneratorParticles; // Use particles only generated by PYTHIA/HERWIG/... and not by the MC tranport G3/G4/FLUKA ...
+  
+  ClassDef(AliCaloTrackMCReader,4)
 } ;