]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
A few updates to the vertex distributions
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 May 2010 13:10:49 +0000 (13:10 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 May 2010 13:10:49 +0000 (13:10 +0000)
PWG2/FORWARD/analysis/AliFMDAnalysisTaskGenerateCorrection.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskSharing.cxx

index d1cc2aebaf6b4a0bc0ea7df23ebbe424f18a0642..fcc17c984b7cbba2c6b7894e53503d0fd34f7a1a 100644 (file)
@@ -125,11 +125,15 @@ void AliFMDAnalysisTaskGenerateCorrection::UserCreateOutputObjects()
   TH1F* hEventsAll    = new TH1F("EventsAll","EventsAll",fNvtxBins,0,fNvtxBins);
   TH1F* hEventsSelectedVtx  = new TH1F("EventsSelectedVtx","EventsSelectedVtx",fNvtxBins,0,fNvtxBins);  
   TH1F* hEventsSelectedTrigger  = new TH1F("EventsSelectedTrigger","EventsSelectedTrigger",fNvtxBins,0,fNvtxBins);
-
   
+  TH1F* hXvtx = new TH1F("hXvtx","x vertex distribution",100,-2,2);
+  TH1F* hYvtx = new TH1F("hYvtx","y vertex distribution",100,-2,2);
+  TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution",4*fNvtxBins,-4*fZvtxCut,4*fZvtxCut);
+  
+  fListOfPrimaries.Add(hXvtx);
+  fListOfPrimaries.Add(hYvtx);
+  fListOfPrimaries.Add(hZvtx);
   
-  //  TH1F* hTriggered    = new TH1F("Triggered","Triggered",fNvtxBins,0,fNvtxBins);
-  // TH1F* hTriggeredAll = new TH1F("TriggeredAll","TriggeredAll",fNvtxBins,0,fNvtxBins);
   hEventsSelected->Sumw2();
   hEventsAll->Sumw2();
   fListOfHits.Add(hEventsSelected);
@@ -179,6 +183,14 @@ void AliFMDAnalysisTaskGenerateCorrection::UserExec(Option_t */*option*/)
   TArrayF vertex;
   genHeader->PrimaryVertex(vertex);
   
+  TH1F* hXvtx = (TH1F*)fListOfPrimaries.FindObject("hXvtx");
+  hXvtx->Fill(vertex.At(0));
+  TH1F* hYvtx = (TH1F*)fListOfPrimaries.FindObject("hYvtx");
+  hYvtx->Fill(vertex.At(1));
+  TH1F* hZvtx = (TH1F*)fListOfPrimaries.FindObject("hZvtx");
+  hZvtx->Fill(vertex.At(2));
+
+  
   if(TMath::Abs(vertex.At(2)) > fZvtxCut)
     return;
   
@@ -419,6 +431,13 @@ void AliFMDAnalysisTaskGenerateCorrection::ReadFromFile(const Char_t* filename,
   fListOfHits.Add(hEventsSelectedTrigger);
   fListOfPrimaries.Add(hEventsAll);
   
+  TH1F* hXvtx = (TH1F*)listOfPrim->FindObject("hXvtx");
+  TH1F* hYvtx = (TH1F*)listOfPrim->FindObject("hYvtx");
+  TH1F* hZvtx = (TH1F*)listOfPrim->FindObject("hZvtx");
+  fListOfPrimaries.Add(hXvtx);
+  fListOfPrimaries.Add(hYvtx);
+  fListOfPrimaries.Add(hZvtx);  
+
   for(Int_t det =1; det<=3;det++)
       {
        Int_t nRings = (det==1 ? 1 : 2);
index 2ad13c542f954c38d8a25bbfba3ca08e91bcc135..db13264b88365b154299aa00825d819d07f81a72 100644 (file)
@@ -111,7 +111,7 @@ void AliFMDAnalysisTaskSharing::CreateOutputObjects()
   fDiagList->Add(hPrimary);
   TH1F* hXvtx = new TH1F("hXvtx","x vertex distribution",100,-2,2);
   TH1F* hYvtx = new TH1F("hYvtx","y vertex distribution",100,-2,2);
-  TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution",pars->GetNvtxBins(),-1*pars->GetVtxCutZ(),pars->GetVtxCutZ());
+  TH1F* hZvtx = new TH1F("hZvtx","z vertex distribution",4*pars->GetNvtxBins(),-4*pars->GetVtxCutZ(),4*pars->GetVtxCutZ());
   
   fDiagList->Add(hXvtx);
   fDiagList->Add(hYvtx);
@@ -714,24 +714,27 @@ void AliFMDAnalysisTaskSharing::ProcessPrimary() {
   AliHeader* header            = mcEvent->Header();
   AliGenEventHeader* genHeader = header->GenEventHeader();
   
-  //  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
+  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader);
+  
+  if (!pythiaGenHeader) {
+    std::cout<<" no pythia header!"<<std::endl;
+    return; 
+  }
   
-  // if (!pythiaGenHeader) {
-    //  std::cout<<" no pythia header!"<<std::endl;
-  //   return; 
-  // }
-
        
-  //Int_t pythiaType = pythiaGenHeader->ProcessType();
-  
-  //if(pythiaType==92||pythiaType==93){
-    //  std::cout<<"single diffractive"<<std::endl;
-    //  return;
-    // }
-  // if(pythiaType==94){
-  //  std::cout<<"double diffractive"<<std::endl;
-  //  return;
-  // }
+  Int_t pythiaType = pythiaGenHeader->ProcessType();
+  
+  /*if(pythiaType==92||pythiaType==93){
+      std::cout<<"single diffractive"<<std::endl;
+      return;
+     }
+  if(pythiaType==94){
+    std::cout<<"double diffractive"<<std::endl;
+    return;
+  }
+  */
+  std::cout<<pythiaType<<"   "<<stack->GetNprimary()<<std::endl;
+  
   
   TArrayF vertex;
   genHeader->PrimaryVertex(vertex);