]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
recover the detector tag int and not the string from the AOD particle
authorgconesab <gustavo.conesa.balbastre@cern.ch>
Sun, 19 Oct 2014 20:43:30 +0000 (22:43 +0200)
committergconesab <gustavo.conesa.balbastre@cern.ch>
Sun, 19 Oct 2014 20:47:39 +0000 (22:47 +0200)
PWG/CaloTrackCorrBase/AliIsolationCut.cxx
PWG/CaloTrackCorrBase/AliMCAnalysisUtils.cxx
PWG/CaloTrackCorrBase/AliMCAnalysisUtils.h
PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.cxx

index a9188a070e29d7e954c7ff4886e5fcd6f2e78ab8..fe8abc2f877183f77687d8191241faa4de131e5b 100755 (executable)
@@ -187,7 +187,7 @@ Float_t AliIsolationCut::GetCellDensity(AliAODPWG4ParticleCorrelation * pCandida
   if(phiC<0) phiC+=TMath::TwoPi();
   Float_t etaC  = pCandidate->Eta() ;
   
-  if(pCandidate->GetDetector()=="EMCAL")
+  if(pCandidate->GetDetectorTag() == AliCaloTrackReader::kEMCAL)
   {
     AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
     AliCalorimeterUtils *cu = reader->GetCaloUtils();
@@ -275,7 +275,7 @@ void AliIsolationCut::GetCoeffNormBadCell(AliAODPWG4ParticleCorrelation * pCandi
   if(phiC<0) phiC+=TMath::TwoPi();
   Float_t etaC  = pCandidate->Eta() ;
   
-  if(pCandidate->GetDetector()=="EMCAL")
+  if(pCandidate->GetDetectorTag() == AliCaloTrackReader::kEMCAL)
   {
     AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
     AliCalorimeterUtils *cu = reader->GetCaloUtils();
index 1d43a5f2f3222e69d295812fb55eaac44b416113..fc196b9e1c15e0371d02ad73aa7382538f71ded5 100755 (executable)
@@ -219,7 +219,7 @@ Int_t AliMCAnalysisUtils::CheckCommonAncestor(Int_t index1, Int_t index2,
 
 //________________________________________________________________________________________
 Int_t AliMCAnalysisUtils::CheckOrigin(const Int_t * label, Int_t nlabels,
-                                      const AliCaloTrackReader* reader, TString calorimeter)
+                                      const AliCaloTrackReader* reader, Int_t calorimeter)
 {
   // Play with the montecarlo particles if available.
   
@@ -231,8 +231,8 @@ Int_t AliMCAnalysisUtils::CheckOrigin(const Int_t * label, Int_t nlabels,
   }
   
   TObjArray* arrayCluster = 0;
-  if      ( calorimeter == "EMCAL" ) arrayCluster = reader->GetEMCALClusters();
-  else if ( calorimeter ==  "PHOS" ) arrayCluster= reader->GetPHOSClusters();
+  if      ( calorimeter == AliCaloTrackReader::kEMCAL ) arrayCluster = reader->GetEMCALClusters();
+  else if ( calorimeter == AliCaloTrackReader::kPHOS  ) arrayCluster = reader->GetPHOSClusters ();
   
   //Select where the information is, ESD-galice stack or AOD mcparticles branch
   if(reader->ReadStack()){
@@ -246,7 +246,7 @@ Int_t AliMCAnalysisUtils::CheckOrigin(const Int_t * label, Int_t nlabels,
 }
 
 //____________________________________________________________________________________________________
-Int_t AliMCAnalysisUtils::CheckOrigin(Int_t label, const AliCaloTrackReader* reader, TString calorimeter)
+Int_t AliMCAnalysisUtils::CheckOrigin(Int_t label, const AliCaloTrackReader* reader, Int_t calorimeter)
 {
   // Play with the montecarlo particles if available.
   
@@ -258,8 +258,8 @@ Int_t AliMCAnalysisUtils::CheckOrigin(Int_t label, const AliCaloTrackReader* rea
   }
   
   TObjArray* arrayCluster = 0;
-  if      ( calorimeter == "EMCAL" ) arrayCluster = reader->GetEMCALClusters();
-  else if ( calorimeter ==  "PHOS" ) arrayCluster= reader->GetPHOSClusters();
+  if      ( calorimeter == AliCaloTrackReader::kEMCAL ) arrayCluster = reader->GetEMCALClusters();
+  else if ( calorimeter == AliCaloTrackReader::kPHOS  ) arrayCluster = reader->GetPHOSClusters();
   
   Int_t labels[]={label};
   
@@ -747,8 +747,10 @@ Int_t AliMCAnalysisUtils::CheckOriginInAOD(const Int_t *labels, Int_t nlabels,
         CheckOverlapped2GammaDecay(labels,nlabels, iParent, mcparticles, tag); //set to kMCPi0 if 2 gammas in same cluster
         // In case it did not merge, check if the decay companion is lost
         if(!CheckTagBit(tag, kMCPi0) && !CheckTagBit(tag,kMCDecayPairInCalo) && !CheckTagBit(tag,kMCDecayPairLost))
+        {
           CheckLostDecayPair(arrayCluster,iMom, iParent, mcparticles, tag);
-
+        }
+        
         //printf("Bit set is Merged %d, Pair in calo %d, Lost %d\n",CheckTagBit(tag, kMCPi0),CheckTagBit(tag,kMCDecayPairInCalo),CheckTagBit(tag,kMCDecayPairLost));
       }
       else if (pPdg == 221)
@@ -1225,7 +1227,7 @@ void    AliMCAnalysisUtils::CheckLostDecayPair(const TObjArray   * arrayCluster,
                                                const TClonesArray* mcparticles, Int_t & tag)
 {
   // Check on AODs if the current decay photon has the second photon companion lost.
-  
+
   if(!arrayCluster || iMom < 0 || iParent < 0|| !mcparticles) return;
 
   AliAODMCParticle * parent = (AliAODMCParticle*) mcparticles->At(iParent);
index 6f2ba395fccc814a735722a1c3f8788cad730d6e..6b5a7d6482b3dd00ea6e20f393e41549d01d71cb 100755 (executable)
@@ -55,10 +55,10 @@ class AliMCAnalysisUtils : public TObject {
   Int_t   CheckCommonAncestor(Int_t index1, Int_t index2, const AliCaloTrackReader* reader, 
                              Int_t & ancPDG, Int_t & ancStatus, TLorentzVector & momentum, TVector3 & v) ;
   
-  Int_t   CheckOrigin(Int_t label, const AliCaloTrackReader * reader, TString calorimeter) ;
+  Int_t   CheckOrigin(Int_t label, const AliCaloTrackReader * reader, Int_t calorimeter) ;
   
   //Check the label of the most significant particle but do checks on the rest of the contributing labels
-  Int_t   CheckOrigin       (const Int_t *label,  Int_t nlabels, const AliCaloTrackReader * reader, TString calorimeter) ;
+  Int_t   CheckOrigin       (const Int_t *label,  Int_t nlabels, const AliCaloTrackReader * reader, Int_t calorimeter) ;
   Int_t   CheckOriginInStack(const Int_t *labels, Int_t nlabels, AliStack * stack               , const TObjArray *arrayCluster) ; // ESD
   Int_t   CheckOriginInAOD  (const Int_t *labels, Int_t nlabels, const TClonesArray* mcparticles, const TObjArray *arrayCluster) ; // AOD
   
index 4a5401f1657e88b9b1c17fca077ec7d1eafa1313..44095a6daa30e7aa3bebb5bf7c763929929f60b3 100755 (executable)
@@ -3139,7 +3139,7 @@ void  AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
       if(IsDataMC())
       {
         Int_t  label2 = photon2->GetLabel();
-        if(label2 >= 0 )photon2->SetTag(GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(),"CTS"));
+        if(label2 >= 0 )photon2->SetTag(GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(),kCTS));
         
         HasPairSameMCMother(photon1->GetLabel(), photon2->GetLabel(),
                             photon1->GetTag()  , photon2->GetTag(),