Fix filling of single module invariant mass histograms
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Dec 2009 09:21:33 +0000 (09:21 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Dec 2009 09:21:33 +0000 (09:21 +0000)
PWG4/PartCorrDep/AliAnaCalorimeterQA.cxx
PWG4/PartCorrDep/AliAnaPi0.cxx

index 57ffc7b..7fabd69 100755 (executable)
@@ -1293,7 +1293,7 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                        nCaloCellsPerCluster2 = clus2->GetNCells();
 
                                }
-                               if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
+                               else if(GetReader()->GetDataType()==AliCaloTrackReader::kAOD){
                                        AliAODCaloCluster* clus2 =  (AliAODCaloCluster*) (caloClusters->At(jclus));
                                        //Get cluster kinematics
                                        clus2->GetMomentum(mom2,v);
@@ -1302,13 +1302,24 @@ void  AliAnaCalorimeterQA::MakeAnalysisFillHistograms()
                                        //Cells per cluster
                                        nCaloCellsPerCluster2 = clus2->GetNCells();
                                }
-                               
+
+                               //Fill invariant mass histograms
+                               //All modules
                                fhIM  ->Fill((mom+mom2).E(),(mom+mom2).M());
-                               fhIMMod[nModule]->Fill((mom+mom2).E(),(mom+mom2).M());
+                               //Single module
+                               if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
+                                 fhIMMod[nModule]->Fill((mom+mom2).E(),(mom+mom2).M());
+
+                               //Select only clusters with at least 2 cells
                                if(nCaloCellsPerCluster > 1 && nCaloCellsPerCluster2 > 1) {
-                                       fhIMCellCut  ->Fill((mom+mom2).E(),(mom+mom2).M());
-                                       if(nModule < fNModules) fhIMCellCutMod[nModule]->Fill((mom+mom2).E(),(mom+mom2).M());
+                                 //All modules
+                                 fhIMCellCut  ->Fill((mom+mom2).E(),(mom+mom2).M());
+                                 //Single modules
+                                 if(nModule == nModule2 && nModule >=0 && nModule < fNModules)
+                                   fhIMCellCutMod[nModule]->Fill((mom+mom2).E(),(mom+mom2).M());
                                }
+
+                               //Asymetry histograms
                                fhAsym->Fill((mom+mom2).E(),TMath::Abs((mom.E()-mom2.E())/(mom.E()+mom2.E())));
                                        
                        }// 2nd cluster loop
index ed6d2b9..5345f76 100755 (executable)
@@ -419,24 +419,24 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
   for(Int_t i1=0; i1<nPhot-1; i1++){
     AliAODPWG4Particle * p1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i1)) ;
     TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E());
-       //Get Module number
-       module1 = GetModuleNumber(p1);
+    //Get Module number
+    module1 = GetModuleNumber(p1);
     for(Int_t i2=i1+1; i2<nPhot; i2++){
       AliAODPWG4Particle * p2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(i2)) ;
       TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E());
-         //Get module number
-         module2 = GetModuleNumber(p2);
+      //Get module number
+      module2 = GetModuleNumber(p2);
       Double_t m  = (photon1 + photon2).M() ;
       Double_t pt = (photon1 + photon2).Pt();
       Double_t a  = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ;
       if(GetDebug() > 2)
        printf("AliAnaPi0::MakeAnalysisFillHistograms() - Current Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n",
               p1->Pt(), p2->Pt(), pt,m,a);
-               //Fill module dependent histograms
-               //if(module1==module2) printf("mod1 %d\n",module1);
-               if(module1==module2 && module1 >=0 && module1<fNModules)
-                       fhReMod[module1]->Fill(pt,a,m) ;
-               
+      //Fill module dependent histograms
+      //if(module1==module2) printf("mod1 %d\n",module1);
+      if(module1==module2 && module1 >=0 && module1<fNModules)
+       fhReMod[module1]->Fill(pt,a,m) ;
+      
       for(Int_t ipid=0; ipid<fNPID; ipid++)
        {
          if((p1->IsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){