T0 trigger based event selection implemented
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2012 08:36:13 +0000 (08:36 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2012 08:36:13 +0000 (08:36 +0000)
T0/AliT0CalibOffsetChannelsTask.cxx

index 3b36281..3431358 100644 (file)
@@ -122,8 +122,8 @@ void AliT0CalibOffsetChannelsTask::UserCreateOutputObjects()
     //    fCFD[i]        = new TH1F(Form("CFD%d",i+1),"CFD",250, -1000, 1000);//6000, 7000);\r
   }\r
 \r
-  fTzeroORAplusORC = new TH1F("fTzeroORAplusORC","ORA+ORC /2",400,-4000,4000);   //or A plus or C \r
-  fResolution      = new TH1F("fResolution","fResolution",400,-2500,2500);// or A minus or C spectrum\r
+  fTzeroORAplusORC = new TH1F("fTzeroORAplusORC","ORA+ORC /2",200,-4000,4000);   //or A plus or C \r
+  fResolution      = new TH1F("fResolution","fResolution",200,-1000,1000);// or A minus or C spectrum\r
   fTzeroORA        = new TH1F("fTzeroORA","fTzeroORA",200,-4000,4000);// or A spectrum\r
   fTzeroORC        = new TH1F("fTzeroORC","fTzeroORC",200,-4000,4000);// or C spectrum\r
 \r
@@ -153,53 +153,64 @@ void AliT0CalibOffsetChannelsTask::UserExec(Option_t *)
   // Called for each event\r
 \r
   // Post output data.\r
+\r
   fESD = dynamic_cast<AliESDEvent*>(InputEvent());\r
   if (!fESD) {\r
     printf("ERROR: fESD not available\n");\r
     return;\r
   }\r
-\r
-  fRunNumber =  fESD->GetRunNumber() ; \r
-\r
+  Int_t trigT0 = fESD->GetT0Trig();\r
+  Bool_t eq = kTRUE;\r
+  fRunNumber =  fESD->GetRunNumber() ;\r
+  if( fRunNumber<165747) eq = kFALSE;\r
+    \r
   const Double32_t* time = fESD->GetT0time();\r
   const Double32_t* amp = fESD->GetT0amplitude();\r
+  \r
   Double32_t diff;\r
-  for (Int_t i=0; i<12; i++) {\r
-    if( time[i] !=0  && amp[i]>0.1 ){\r
-      fCFD[i]->Fill( time[i] );\r
-      //  printf(" time %f ocdb %f \n", time[i],fCDBcfds[i]); \r
-      \r
-      if(  time[fRefPMTC] != 0 ) {\r
-       diff =  time[i]-time[fRefPMTC] + fCDBdelays[i];\r
-       fTimeDiff[i]->Fill( diff);\r
-      }\r
-    }\r
-  }\r
-  for (Int_t i=12; i<24; i++) {\r
-    if( time[i] != 0 && amp[i]>0.1) {\r
-      fCFD[i]->Fill( time[i]);\r
-      //  printf(" time %f ocdb %f \n", time[i],fCDBcfds[i]); \r
-       if( time[fRefPMTA] != 0 ) {\r
-       diff =  time[i]-time[fRefPMTA] + fCDBdelays[i];\r
-       fTimeDiff[i]->Fill( diff);\r
-      }\r
+  for (Int_t i=0; i<24; i++) {\r
+    if( time[i] > 0  && amp[i]>0.1 ){\r
+      if (eq)  {\r
+       fCFD[i]->Fill( time[i] );\r
+       if(  time[fRefPMTC] > 0 && i<12)   {\r
+         diff =  time[i]-time[fRefPMTC];\r
+         fTimeDiff[i]->Fill( diff);\r
+       }\r
+       if(  time[fRefPMTA] >0  && i>11)  {\r
+         diff =  time[i]-time[fRefPMTA] ;\r
+         fTimeDiff[i]->Fill( diff);\r
+       }\r
+      } //eq=1\r
+      else  {\r
+       fCFD[i]->Fill( time[i] + fCDBdelays[i] );\r
+       if(  time[fRefPMTC] > 0 && i<12) {\r
+         diff =  time[i]-time[fRefPMTC] + fCDBdelays[i];\r
+         fTimeDiff[i]->Fill( diff);\r
+       } //C\r
+       if(  time[fRefPMTA] >0  && i>11) {\r
+         diff =  time[i]-time[fRefPMTA] + fCDBdelays[i];\r
+         fTimeDiff[i]->Fill( diff);\r
+       } //A\r
+      } //eq=0\r
     }\r
+    \r
   }\r
-  const Double32_t* mean = fESD->GetT0TOF();\r
-  Double32_t meanTOF = mean[0] +  fCDBT0s[0];\r
-  Double32_t orA = mean[1]  +  fCDBT0s[1];\r
-  Double32_t orC = mean[2] +  fCDBT0s[2];\r
\r
-  if(orA<9999) fTzeroORA->Fill(orA);\r
-  if(orC<9999) fTzeroORC->Fill(orC);\r
-  if(orA<9999 && orC<9999) fResolution->Fill((orA-orC)/2.);\r
-  if(orA<9999 && orC<9999) fTzeroORAplusORC->Fill(meanTOF); \r
-\r
-  //  printf("%f   %f  %f\n",orA,orC,meanTOF);\r
+  if (trigT0>5) {\r
+    const Double32_t* mean = fESD->GetT0TOF();\r
+    Double32_t meanTOF = mean[0]  +  fCDBT0s[0] ;\r
+    Double32_t orA = mean[1]  +  fCDBT0s[1] ;\r
+    Double32_t orC = mean[2] + fCDBT0s[2] ;\r
+    \r
+    if(orA<9999) fTzeroORA->Fill(orA);\r
+    if(orC<9999) fTzeroORC->Fill(orC);\r
+    if(orA<9999 && orC<9999) fResolution->Fill((orA-orC)/2.);\r
+    if(orA<9999 && orC<9999) fTzeroORAplusORC->Fill(meanTOF); \r
+  } //if TVDC on\r
+    //  printf("%f   %f  %f\n",orA,orC,meanTOF);\r
   PostData(1, fTzeroObject);\r
-}      \r
+  }      \r
  //________________________________________________________________________\r
-void AliT0CalibOffsetChannelsTask::Terminate(Option_t *) \r
+  void AliT0CalibOffsetChannelsTask::Terminate(Option_t *) \r
 {\r
   \r
    // Called once at the end of the query\r