Tuning lumimeters and event counters
authormbroz <Michal.Broz@cern.ch>
Mon, 24 Feb 2014 13:56:48 +0000 (14:56 +0100)
committermbroz <Michal.Broz@cern.ch>
Mon, 24 Feb 2014 13:56:48 +0000 (14:56 +0100)
PWGUD/UPC/AliAnalysisTaskUpcPsi2s.cxx

index 9e60155..c84f275 100644 (file)
@@ -267,10 +267,10 @@ void AliAnalysisTaskUpcPsi2s::UserCreateOutputObjects()
   fListHist = new TList();
   fListHist ->SetOwner();
   
-  TString CutNameJPsi[12] = {"Analyzed","Triggered","Vertex cut","V0 decision","Two good tracks",
+  TString CutNameJPsi[13] = {"Analyzed","Triggered","Vertex cut","V0 decision","Neutron ZDC cut","Two good tracks",
                                "Like sign","Oposite sign","One p_{T}>1", "Both p_{T}>1","PID","Dimuom","Dielectron"};
-  fHistNeventsJPsi = new TH1D("fHistNeventsJPsi","fHistNeventsPsi2s",12,0.5,12.5);
-  for (Int_t i = 0; i<12; i++) fHistNeventsJPsi->GetXaxis()->SetBinLabel(i+1,CutNameJPsi[i].Data());
+  fHistNeventsJPsi = new TH1D("fHistNeventsJPsi","fHistNeventsPsi2s",13,0.5,13.5);
+  for (Int_t i = 0; i<13; i++) fHistNeventsJPsi->GetXaxis()->SetBinLabel(i+1,CutNameJPsi[i].Data());
   fListHist->Add(fHistNeventsJPsi);
   
   fHistTPCsignalJPsi = new TH2D("fHistTPCsignalJPsi","fHistTPCsignalJPsi",240,0,120,240,0,120);
@@ -287,11 +287,11 @@ void AliAnalysisTaskUpcPsi2s::UserCreateOutputObjects()
   fHistDiMuonMass->GetXaxis()->SetTitle("Invariant mass(#mu^{+}#mu^{-}) (GeV/c)");
   fListHist->Add(fHistDiMuonMass);
 
-  TString CutNamePsi2s[13] = {"Analyzed","Triggered","Vertex cut","V0 decision","Four good tracks",
+  TString CutNamePsi2s[14] = {"Analyzed","Triggered","Vertex cut","V0 decision","Neutron ZDC cut","Four good tracks",
                                "DiLepton - DiPion","Like sign leptons","Like sign pions","Like sign both","Oposite sign","PID","Dimuom","Dielectron"};
 
-  fHistNeventsPsi2s = new TH1D("fHistNeventsPsi2s","fHistNeventsPsi2s",13,0.5,13.5);
-  for (Int_t i = 0; i<13; i++) fHistNeventsPsi2s->GetXaxis()->SetBinLabel(i+1,CutNamePsi2s[i].Data());
+  fHistNeventsPsi2s = new TH1D("fHistNeventsPsi2s","fHistNeventsPsi2s",14,0.5,14.5);
+  for (Int_t i = 0; i<14; i++) fHistNeventsPsi2s->GetXaxis()->SetBinLabel(i+1,CutNamePsi2s[i].Data());
   fListHist->Add(fHistNeventsPsi2s);
 
   fHistPsi2sMassVsPt = new TH2D("fHistPsi2sMassVsPt","Mass vs p_{T} of #psi(2s) candidates",100,3,6,50,0,5);
@@ -356,16 +356,11 @@ void AliAnalysisTaskUpcPsi2s::RunAODtrig()
   Double_t percentile = centrality->GetCentralityPercentileUnchecked("V0M");
   //Double_t percentile = centrality->GetCentralityPercentile("V0M");
   
-  if( ((selectionMask & AliVEvent::kMB) == AliVEvent::kMB) || 
-      ((selectionMask & AliVEvent::kSemiCentral) == AliVEvent::kSemiCentral) || 
-      ((selectionMask & AliVEvent::kCentral) == AliVEvent::kCentral) ){
-      
-      if(percentile<80 && percentile>0) fHistMBTriggersPerRun->Fill(fRunNum);
-      if(percentile<6 && percentile>0 && (trigger.Contains("CVHN_R2-B"))) fHistCentralTriggersPerRun->Fill(fRunNum);
-      if(percentile<50 && percentile>15 && (trigger.Contains("CVLN_B2-B"))) fHistSemiCentralTriggersPerRun->Fill(fRunNum);
-      if(percentile<50 && percentile>15 && (trigger.Contains("CVLN_R1-B"))) fHistSemiCentralTriggersPerRun->Fill(fRunNum);
-      
-      }
+  if(((selectionMask & AliVEvent::kMB) == AliVEvent::kMB) && percentile<=80 && percentile>=0) fHistMBTriggersPerRun->Fill(fRunNum);
+  
+  if(((selectionMask & AliVEvent::kCentral) == AliVEvent::kCentral) && percentile<=6 && percentile>=0) fHistCentralTriggersPerRun->Fill(fRunNum);
+
+  if(((selectionMask & AliVEvent::kSemiCentral) == AliVEvent::kSemiCentral) && percentile<=50 && percentile>=15) fHistSemiCentralTriggersPerRun->Fill(fRunNum);
     
 PostData(3, fListTrig);
 
@@ -416,13 +411,16 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
   fV0Cdecision = fV0data->GetV0CDecision();
   if(fV0Adecision != AliAODVZERO::kV0Empty || fV0Cdecision != AliAODVZERO::kV0Empty) return;
   
+  fHistNeventsJPsi->Fill(4);
+  fHistNeventsPsi2s->Fill(4);
+  
   fZDCAenergy = fZDCdata->GetZNATowerEnergy()[0];
   fZDCCenergy = fZDCdata->GetZNCTowerEnergy()[0];
 
   if( fZDCAenergy > 8200 || fZDCCenergy > 8200) return;
   
-  fHistNeventsJPsi->Fill(4);
-  fHistNeventsPsi2s->Fill(4);
+  fHistNeventsJPsi->Fill(5);
+  fHistNeventsPsi2s->Fill(5);
 
   //Two tracks loop
   Int_t nGoodTracks = 0;
@@ -439,6 +437,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
   for(Int_t itr=0; itr<aod ->GetNumberOfTracks(); itr++) {
     AliAODTrack *trk = aod->GetTrack(itr);
     if( !trk ) continue;
+    if(!(trk->TestFilterBit(1<<0))) continue;
 
       if(!(trk->GetStatus() & AliESDtrack::kTPCrefit) ) continue;
       if(!(trk->GetStatus() & AliESDtrack::kITSrefit) ) continue;
@@ -461,7 +460,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
   mass[0]= -1; mass[1]= -1, mass[2]= -1;
   
   if(nGoodTracks == 4){
-         fHistNeventsPsi2s->Fill(5);
+         fHistNeventsPsi2s->Fill(6);
          for(Int_t i=0; i<4; i++){
                AliAODTrack *trk = aod->GetTrack(TrackIndex[i]);
                
@@ -487,20 +486,20 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
                if(nLepton > 2 || nPion > 2) break;
                }
        if((nLepton == 2) && (nPion == 2)){
-               fHistNeventsPsi2s->Fill(6);
-               if(qLepton[0]*qLepton[1] > 0) fHistNeventsPsi2s->Fill(7);
-               if(qPion[0]*qPion[1] > 0) fHistNeventsPsi2s->Fill(8);
-               if((qLepton[0]*qLepton[1] > 0) && (qPion[0]*qPion[1] > 0)) fHistNeventsPsi2s->Fill(9);
+               fHistNeventsPsi2s->Fill(7);
+               if(qLepton[0]*qLepton[1] > 0) fHistNeventsPsi2s->Fill(8);
+               if(qPion[0]*qPion[1] > 0) fHistNeventsPsi2s->Fill(9);
+               if((qLepton[0]*qLepton[1] > 0) && (qPion[0]*qPion[1] > 0)) fHistNeventsPsi2s->Fill(10);
                if((qLepton[0]*qLepton[1] < 0) && (qPion[0]*qPion[1] < 0)){
-                       fHistNeventsPsi2s->Fill(10);
+                       fHistNeventsPsi2s->Fill(11);
                        if(mass[0] == mass[1]) {
-                               fHistNeventsPsi2s->Fill(11); 
+                               fHistNeventsPsi2s->Fill(12); 
                                vCandidate = vLepton[0]+vLepton[1]+vPion[0]+vPion[1];
                                vDilepton = vLepton[0]+vLepton[1];
                                fHistPsi2sMassVsPt->Fill(vCandidate.M(),vCandidate.Pt());
                                if(vCandidate.Pt() < 0.15) fHistPsi2sMassCoherent->Fill(vCandidate.M());
-                               if(mass[0] == 0) fHistNeventsPsi2s->Fill(12);   
-                               if(mass[0] == 1) fHistNeventsPsi2s->Fill(13);
+                               if(mass[0] == 0) fHistNeventsPsi2s->Fill(13);   
+                               if(mass[0] == 1) fHistNeventsPsi2s->Fill(14);
                                }
                        }
                }
@@ -511,6 +510,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
   for(Int_t itr=0; itr<aod ->GetNumberOfTracks(); itr++) {
     AliAODTrack *trk = aod->GetTrack(itr);
     if( !trk ) continue;
+    if(!(trk->TestFilterBit(1<<0))) continue;
 
       if(!(trk->GetStatus() & AliESDtrack::kTPCrefit) ) continue;
       if(!(trk->GetStatus() & AliESDtrack::kITSrefit) ) continue;
@@ -534,7 +534,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
   mass[0]= -1; mass[1]= -1, mass[2]= -1;
 
   if(nGoodTracks == 2){
-         fHistNeventsJPsi->Fill(5);
+         fHistNeventsJPsi->Fill(6);
          for(Int_t i=0; i<2; i++){
                AliAODTrack *trk = aod->GetTrack(TrackIndex[i]);                
                if(trk->Pt() > 1) nHighPt++;     
@@ -551,24 +551,24 @@ void AliAnalysisTaskUpcPsi2s::RunAODhist()
                        nLepton++;              
                }               
        if(nLepton == 2){
-               if(qLepton[0]*qLepton[1] > 0) fHistNeventsJPsi->Fill(6);
+               if(qLepton[0]*qLepton[1] > 0) fHistNeventsJPsi->Fill(7);
                if(qLepton[0]*qLepton[1] < 0){
-                       fHistNeventsJPsi->Fill(7);
+                       fHistNeventsJPsi->Fill(8);
                        if(nHighPt > 0){
-                               fHistNeventsJPsi->Fill(8);
+                               fHistNeventsJPsi->Fill(9);
                                fHistTPCsignalJPsi->Fill(fRecTPCsignal[0],fRecTPCsignal[1]);
-                               if(nHighPt == 2) fHistNeventsJPsi->Fill(9);
+                               if(nHighPt == 2) fHistNeventsJPsi->Fill(10);
                                if(mass[0] == mass[1] && mass[0] != -1) {
-                                       fHistNeventsJPsi->Fill(10);
+                                       fHistNeventsJPsi->Fill(11);
                                        vCandidate = vLepton[0]+vLepton[1];
                                        if( vCandidate.M() > 2.8 && vCandidate.M() < 3.2) fHistDiLeptonPtJPsi->Fill(vLepton[0].Pt(),vLepton[1].Pt());
                                        if(mass[0] == 0) {
                                                fHistDiMuonMass->Fill(vCandidate.M());
-                                               fHistNeventsJPsi->Fill(11);
+                                               fHistNeventsJPsi->Fill(12);
                                                }
                                        if(mass[0] == 1) {
                                                fHistDiElectronMass->Fill(vCandidate.M());
-                                               fHistNeventsJPsi->Fill(12);
+                                               fHistNeventsJPsi->Fill(13);
                                                }
                                        }
                                }
@@ -649,6 +649,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODtree()
   for(Int_t itr=0; itr<aod ->GetNumberOfTracks(); itr++) {
     AliAODTrack *trk = aod->GetTrack(itr);
     if( !trk ) continue;
+    if(!(trk->TestFilterBit(1<<0))) continue;
 
       if(!(trk->GetStatus() & AliAODTrack::kTPCrefit) ) continue;
       if(!(trk->GetStatus() & AliAODTrack::kITSrefit) ) continue;
@@ -663,8 +664,8 @@ void AliAnalysisTaskUpcPsi2s::RunAODtree()
   for(Int_t itr=0; itr<aod ->GetNumberOfTracks(); itr++) {
     AliAODTrack *trk = aod->GetTrack(itr);
     if( !trk ) continue;
-    if(!(trk->TestFilterBit(1<<0)))continue;
-
+    if(!(trk->TestFilterBit(1<<0))) continue;
+    
       if(!(trk->GetStatus() & AliAODTrack::kTPCrefit) ) continue;
       if(!(trk->GetStatus() & AliAODTrack::kITSrefit) ) continue;
       if(trk->GetTPCNcls() < 70)continue;
@@ -753,7 +754,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODtree()
   for(Int_t itr=0; itr<aod ->GetNumberOfTracks(); itr++) {
     AliAODTrack *trk = aod->GetTrack(itr);
     if( !trk ) continue;
-    if(!(trk->TestFilterBit(1<<0)))continue;
+    if(!(trk->TestFilterBit(1<<0))) continue;
 
       if(!(trk->GetStatus() & AliAODTrack::kTPCrefit) ) continue;
       if(!(trk->GetStatus() & AliAODTrack::kITSrefit) ) continue;
@@ -774,7 +775,7 @@ void AliAnalysisTaskUpcPsi2s::RunAODtree()
       
     
   if(nGoodTracks == 4){
-  
+
          TDatabasePDG *pdgdat = TDatabasePDG::Instance();
          TParticlePDG *partMuon = pdgdat->GetParticle( 13 );
          Double_t muonMass = partMuon->Mass();  
@@ -867,11 +868,11 @@ void AliAnalysisTaskUpcPsi2s::RunESDtrig()
   //Double_t percentile = centrality->GetCentralityPercentile("V0M");
   Double_t percentile = centrality->GetCentralityPercentileUnchecked("V0M");
   
-  if(((selectionMask & AliVEvent::kMB) == AliVEvent::kMB) && percentile<80 && percentile>0) fHistMBTriggersPerRun->Fill(fRunNum);
+  if(((selectionMask & AliVEvent::kMB) == AliVEvent::kMB) && percentile<=80 && percentile>=0) fHistMBTriggersPerRun->Fill(fRunNum);
   
-  if(((selectionMask & AliVEvent::kCentral) == AliVEvent::kCentral) && percentile<6 && percentile>0) fHistCentralTriggersPerRun->Fill(fRunNum);
+  if(((selectionMask & AliVEvent::kCentral) == AliVEvent::kCentral) && percentile<=6 && percentile>=0) fHistCentralTriggersPerRun->Fill(fRunNum);
 
-  if(((selectionMask & AliVEvent::kSemiCentral) == AliVEvent::kSemiCentral) && percentile<50 && percentile>15) fHistSemiCentralTriggersPerRun->Fill(fRunNum);
+  if(((selectionMask & AliVEvent::kSemiCentral) == AliVEvent::kSemiCentral) && percentile<=50 && percentile>=15) fHistSemiCentralTriggersPerRun->Fill(fRunNum);
 
   
 PostData(3, fListTrig);