Analysis of calibration data, to be add as addition task to cpass1
authoralla <Alla.Maevskaya@cern.ch>
Mon, 3 Nov 2014 09:08:37 +0000 (13:08 +0400)
committeralla <Alla.Maevskaya@cern.ch>
Mon, 3 Nov 2014 09:10:45 +0000 (13:10 +0400)
T0/AliT0CalibAnalysisTask.cxx
T0/AliT0CalibAnalysisTask.h

index a2e5e0c..630b741 100644 (file)
@@ -30,14 +30,14 @@ ClassImp(AliT0CalibAnalysisTask)
 AliT0CalibAnalysisTask::AliT0CalibAnalysisTask(const char *name) 
   : AliAnalysisTaskSE(name), fESD(0), fOutputList(0), 
   fT0OutTree(0x0), fEvent(-99999),   fOrbit(-99999), fBC(-99999),
-  fTrackletSPD(-99999), fClustersSPD(-99999), fNcont(-99999), fNcontTPC(-99999),
-  fVertex(-99999), fVertexcalc(-99999), fVertexSPD(-99999), fVertexTPC(-99999),
-  fMeanAC(-99999), fMeanA(-99999),fMeanC(-99999), fMeanACcalc(-99999), fMeanAcalc(-99999), fMeanCcalc(-99999),
+  fTrackletSPD(-99999), fNcont(-99999),
+  fVertex(-99999), fVertexSPD(-99999), 
+  fMeanAC(-99999), fMeanA(-99999),fMeanC(-99999), 
   fMultV0A(-99999), fMultV0C(-99999),fTimeV0A(-99999),fTimeV0C(-99999), fSumampA(-99999), fSumampC(-99999),
   ftimestamp(0), fSep2(0),
   fZDCcut(kFALSE), fT0Trigger(0), fpileup(kFALSE), fTrigger(0x0),
   fT0_amplitude(0x0), fT0_time(0x0),
-  fcentralityV0M(0), fcentralityZDC(0), fcentralityTRK(0), fcentralityCLA(0),
+  fcentralityV0M(0), fcentralityZDC(0), fcentralityTRK(0),
   fESDtracks(0),
   fMultiplicity(-99999),
   fTriggerinput(0x0), fZDCbg(kFALSE),
@@ -87,15 +87,12 @@ void AliT0CalibAnalysisTask::UserCreateOutputObjects()
   fT0OutTree->Branch("fOrbit", &fOrbit);
   fT0OutTree->Branch("fBC", &fBC);
   fT0OutTree->Branch("fNcont", &fNcont, "fNcont/I");
-  fT0OutTree->Branch("fNcontTPC", &fNcontTPC);
-  fT0OutTree->Branch("fVertexTPC", &fVertexTPC);
   fT0OutTree->Branch("vertexT0", &fVertex, "fVertex/F");
   fT0OutTree->Branch("vertexSPD", &fVertexSPD, "vertexSPD/F");
   fT0OutTree->Branch("meanAC", &fMeanAC,"meanAC/F");
   fT0OutTree->Branch("meanA", &fMeanA,"meanA/F");
   fT0OutTree->Branch("meanC", &fMeanC,"meanC/F");
   fT0OutTree->Branch("trackletSPD", &fTrackletSPD,"trackletSPD/I");
-  fT0OutTree->Branch("clustersSPD", &fClustersSPD,"clustersSPD/I");
   fT0OutTree->Branch("TOFtracks", &fTOFtracks);
   fT0OutTree->Branch("ESDtracks", &fESDtracks);
   fT0OutTree->Branch("multV0A", &fMultV0A,"multV0A/F");
@@ -114,27 +111,19 @@ void AliT0CalibAnalysisTask::UserCreateOutputObjects()
   fT0OutTree->Branch("centralityV0M", &fcentralityV0M);
   fT0OutTree->Branch("centralityZDC", &fcentralityZDC);
   fT0OutTree->Branch("centralityTRK", &fcentralityTRK);
-  fT0OutTree->Branch("centralityCLA", &fcentralityCLA);
   for ( Int_t i=0; i<24; i++) {
     fT0OutTree->Branch(Form("amp%i", i+1), &famp[i]);
     fT0OutTree->Branch(Form("time%i", i+1), &ftime[i]);
-    fT0OutTree->Branch(Form("ftimefriend%i", i+1), &ftimefriend[i]);
-    fT0OutTree->Branch(Form("fampfriend%i", i+1), &fampfriend[i]);
-    fT0OutTree->Branch(Form("fampledfriend%i", i+1), &fampledfriend[i]);
+   fT0OutTree->Branch(Form("fRawTime%i", i+1), &fRawTime[i]);
   } 
   for ( Int_t i=0; i<5; i++) {
     fT0OutTree->Branch(Form("fOrA%i", i+1), &fOrA[i]);
     fT0OutTree->Branch(Form("fOrC%i", i+1), &fOrC[i]);
     fT0OutTree->Branch(Form("fTVDC%i", i+1), &fTVDC[i]);  
-    for ( Int_t ii=0; ii<24; ii++) 
-      fT0OutTree->Branch(Form("fRawTime%i_%i", ii+1, i+1), &fRawTime[ii][i]);
   }
   TString pilename[3] = {"T0pileup", "T0background", "T0satellite"};
   for ( Int_t i=0; i<3; i++) 
     fT0OutTree->Branch(pilename[i].Data(), &fT0pileup[i]);
-  fT0OutTree->Branch("meanACbest", &fMeanACcalc,"meanACcalc/F");
-  fT0OutTree->Branch("meanAbest", &fMeanAcalc,"meanAcalc/F");
-  fT0OutTree->Branch("meanCbest", &fMeanCcalc,"meanCcalc/F");
   fT0OutTree->Branch("multEstimator", &fMultiplicity);
   //ZDC background
  fT0OutTree->Branch("zbg", &fZDCbg);
@@ -151,21 +140,18 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
 {
   // Main loop
   // Called for each event
-   fVertex= fVertexSPD =  fMeanAC = fMeanA =  fMeanC =  fTrackletSPD=-99999;
-  fMeanACcalc = fMeanAcalc =  fMeanCcalc = fNcont = fNcontTPC = -99999;
+  fVertex= fVertexSPD =  fMeanAC = fMeanA =  fMeanC =  fTrackletSPD = fNcont = -99999;
   fMultV0A=fMultV0C=fTimeV0A=fTimeV0C=fMultiplicity = -99999;
   
-  for (Int_t i=0; i<24; i++) {
-    famp[i] = ftime[i] = -9999;
-    for ( Int_t i0=0; i0<5; i0++) {
-      fRawTime[i][i0] = -9999;
-      if(i0==0) { 
-       fTVDC[i0]=-9999;
-       fOrC[i0]=-9999;
-       fOrA[i0]=-9999;
-      }
-    }
+  for (Int_t i=0; i<24; i++) 
+    famp[i] = ftime[i] = fRawTime[i] = -9999;
+  
+  for ( Int_t i0=0; i0<5; i0++) {
+    fTVDC[i0]=-9999;
+    fOrC[i0]=-9999;
+    fOrA[i0]=-9999;
   }
+  
   Float_t orA , orC, tvdc;
   orA = orC = tvdc = -9999;
   fBC = -9999;
@@ -175,28 +161,26 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
     printf("ERROR: fESD not available\n");
     return;
   }
-
+  
   if(fESD)
     {
       //    if(fIsSelected) 
       {
        fZDCbg = kFALSE;
        /*
-       AliTriggerAnalysis *fTriggerAnalysis;
-       Bool_t  fZDCbgA = fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kZNABG);
-       Bool_t  fZDCbgC =  fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kZNCBG);
-       fZDCbg = (fZDCbgA);
-       cout<<" ZDC back "<<fZDCbgA<<endl;
+         AliTriggerAnalysis *fTriggerAnalysis;
+         Bool_t        fZDCbgA = fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kZNABG);
+         Bool_t        fZDCbgC =  fTriggerAnalysis->IsOfflineTriggerFired(fESD, AliTriggerAnalysis::kZNCBG);
+         fZDCbg = (fZDCbgA);
+         cout<<" ZDC back "<<fZDCbgA<<endl;
        */
        AliESDVZERO* esdV0 = fESD->GetVZEROData();
        const AliMultiplicity *mult = fESD->GetMultiplicity();
        // printf(" VZERO MULT \n");
        AliESDTZERO* tz= (AliESDTZERO*) fESD->GetESDTZERO();
-
+       
        const Double32_t *amp, *time, *mean ;
-       const Double32_t *meanbest;
-       fVertex= fVertexSPD =  fMeanAC = fMeanA =  fMeanC =  fTrackletSPD=-99999;
-       fMeanACcalc = fMeanAcalc =  fMeanCcalc = fNcont = fNcontTPC -99999;
+       fVertex= fVertexSPD =  fMeanAC = fMeanA =  fMeanC = fTrackletSPD = fNcont =-99999;
        fMultV0A=fMultV0C=fTimeV0A=fTimeV0C=fMultiplicity = -99999;
        
        fSumampA=0;
@@ -207,13 +191,10 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
        TString inputtriggers =fESD-> GetHeader()->GetFiredTriggerInputs();
        // cout<<inputtriggers<<endl;
        fTriggerinput.SetString(inputtriggers.Data());
-       
-       
        fEvent=fESD->GetEventNumberInFile();
        fT0Trigger=fESD->GetT0Trig();
        
        fESDtracks=fESD->GetNumberOfTracks();
-       AliTriggerAnalysis *trigAna = new AliTriggerAnalysis;
        ftimestamp=fESD->GetTimeStamp(); // - 1301217882; 
        //        printf (" timestamp %d \n", ftimestamp);
        
@@ -222,14 +203,10 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
        fOrbit=fESD->GetOrbitNumber();
        fBC=fESD->GetBunchCrossNumber();
        fNcont = fESD->GetPrimaryVertexSPD()->GetNContributors();
-       fNcontTPC = fESD->GetPrimaryVertexTPC()->GetNContributors();
-       if(fNcontTPC>=2 )
-         fVertexTPC = fESD->GetPrimaryVertexTPC() ->GetZ();
        if(fNcont>=0 ) {
          fVertexSPD = fESD->GetPrimaryVertex()->GetZ();
        }
        fTrackletSPD = mult->GetNumberOfTracklets();
-       fClustersSPD = mult->GetNumberOfITSClusters(0); 
        fMultV0A =  esdV0->GetMTotV0A();
        fMultV0C =  esdV0->GetMTotV0C();
        //TOF hit  
@@ -251,24 +228,18 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
          fT0tofTrack =(Float_t) (fESDpid->GetTOFResponse().GetStartTime(10.0)); //Get start time "from all tracks 
          //   printf("@@TOF T0 %f\n",fT0tofTrack);
        }       
-       
-       
        fpileup = fESD->IsPileupFromSPD();
        fTimeV0C = esdV0->GetV0CTime();
        fTimeV0A = esdV0->GetV0ATime();
-       //        printf(" Vo info \n");      
-       
-       
+       //T0 info
        mean = fESD->GetT0TOF();
        fVertex=fESD->GetT0zVertex();
        fMeanA = mean[1];
        fMeanC = mean[2];
        if (TMath::Abs(fMeanA)<9999 && TMath::Abs(fMeanC)<9999) 
-           fMeanAC = mean[0] ;
+         fMeanAC = mean[0] ;
        fSumampC = tz->GetMultC();
        fSumampA = tz->GetMultA();
-       //    printf("!!!!!!!!fSumampC %f fSumampA %f \n",fSumampC, fSumampA);
-       
        amp=fESD->GetT0amplitude();
        time=fESD->GetT0time();
        for (Int_t i=0; i<24; i++){ 
@@ -278,12 +249,7 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
          }
        }
        
-       //new raw OrA OrC TVDC
-       meanbest = tz->GetT0TOFbest();
-       fMeanAcalc = meanbest[1];
-       fMeanCcalc = meanbest[2];
-       if (TMath::Abs(fMeanAcalc)<9999 && TMath::Abs(fMeanCcalc)<9999) 
-         fMeanACcalc = meanbest[0] ;
+       //new raw OrA OrC TVDC all CFD
        for (Int_t ii=0; ii<5; ii++){ 
          orA   = tz->GetOrA(ii);
          orC   = tz->GetOrC(ii);
@@ -304,39 +270,21 @@ void AliT0CalibAnalysisTask::UserExec(Option_t *)
          if ( ii>0 && fTVDC[ii-1] != tvdc)     fTVDC[ii] = tvdc;
          else fTVDC[ii]=-9999;
          }
-         for (Int_t iii=0; iii<24; iii++)
-           fRawTime[iii][ii] =  tz->GetTimeFull(iii,ii);
        }
+       for (Int_t iii=0; iii<24; iii++)
+         fRawTime[iii] =  tz->GetTimeFull(iii,0);
+       
        fT0pileup[0] = tz->GetPileupFlag();
        fT0pileup[1] = tz->GetBackgroundFlag();
        fT0pileup[2] = tz->GetSatellite();
        
        AliCentrality *centrality = fESD->GetCentrality();
-       
        //The centrality function you can use
        if(centrality) {
          fcentralityV0M = centrality->GetCentralityPercentile("V0M"); // returns the centrality 
          fcentralityTRK = centrality->GetCentralityPercentile("TRK"); // returns the centrality 
          fcentralityZDC = centrality->GetCentralityPercentile("ZEMvsZDC"); // returns the 
-       }
-       AliESDfriend* esdFriend = static_cast<AliESDfriend*>(fESD->FindListObject("AliESDfriend"));
-       if (esdFriend) {
-         //      cout<<" !!!!!esdFriend "<<endl;
-         AliESDTZEROfriend * t0friend =esdFriend-> GetTZEROfriend();
-         //      cout<<" !!!!t0friend "<<t0friend<<endl;
-         if(t0friend){
-           Double_t  *ftimefr =  t0friend->GetT0timeCorr();
-           Double_t  *fampqtcfr =  t0friend->GetT0ampQTC();
-           Double_t  *fampledfr =  t0friend->GetT0ampLEDminCFD();
-           for (Int_t iii=0; iii<24; iii++){
-             ftimefriend[iii]=ftimefr[iii];
-             fampfriend[iii]=fampqtcfr[iii];
-             fampledfriend[iii]=fampledfr[iii];
-             //              cout<<" friend "<<ftimefriend[iii]<<endl;
-           }
-         } //t0friend
-       } //ESDfriend
-       
+       }       
       
       } //selected
     } //ESD
index 49b2421..0361096 100644 (file)
@@ -20,14 +20,14 @@ class AliT0CalibAnalysisTask : public AliAnalysisTaskSE {
  public:
   AliT0CalibAnalysisTask() : AliAnalysisTaskSE(), 
     fESD(0), fOutputList(0), fT0OutTree(0), fEvent(-99999),   fOrbit(-99999), fBC(-99999),
-  fTrackletSPD(-99999), fClustersSPD(-99999), fNcont(-99999), fNcontTPC(-99999),
-  fVertex(-99999), fVertexcalc(-99999), fVertexSPD(-99999), fVertexTPC(-99999),
-  fMeanAC(-99999), fMeanA(-99999),fMeanC(-99999), fMeanACcalc(-99999), fMeanAcalc(-99999), fMeanCcalc(-99999),
+  fTrackletSPD(-99999),  fNcont(-99999),
+  fVertex(-99999),  fVertexSPD(-99999), 
+  fMeanAC(-99999), fMeanA(-99999),fMeanC(-99999), 
   fMultV0A(-99999), fMultV0C(-99999),fTimeV0A(-99999),fTimeV0C(-99999), fSumampA(-99999), fSumampC(-99999),
   ftimestamp(0), fSep2(0),
   fZDCcut(kFALSE), fT0Trigger(-99999), fpileup(kFALSE), fTrigger(0x0),
   fT0_amplitude(0x0), fT0_time(0x0),
-  fcentralityV0M(0), fcentralityZDC(0), fcentralityTRK(0), fcentralityCLA(0),
+  fcentralityV0M(0), fcentralityZDC(0), fcentralityTRK(0), 
   fESDtracks(-99999),
     fMultiplicity(-99999),
   fTriggerinput(0x0), fZDCbg(kFALSE),
@@ -50,19 +50,12 @@ class AliT0CalibAnalysisTask : public AliAnalysisTaskSE {
   Int_t fOrbit;
   Int_t fBC;
   Int_t fTrackletSPD;
-  Int_t fClustersSPD;
   Int_t fNcont;
-  Int_t fNcontTPC;
   Float_t fVertex;
-  Float_t fVertexcalc;
   Float_t fVertexSPD;
-  Float_t fVertexTPC;
   Float_t fMeanAC;
   Float_t fMeanA;
   Float_t fMeanC;
-  Float_t fMeanACcalc;
-  Float_t fMeanAcalc;
-  Float_t fMeanCcalc;
   Float_t fMultV0A;
   Float_t fMultV0C;
   Float_t fTimeV0A;
@@ -80,7 +73,6 @@ class AliT0CalibAnalysisTask : public AliAnalysisTaskSE {
   Float_t fcentralityV0M;
   Float_t fcentralityZDC;
   Float_t fcentralityTRK;
-  Float_t fcentralityCLA;
   Int_t fESDtracks;
   Float_t fOrA[5];
   Float_t fOrC[5];
@@ -88,7 +80,7 @@ class AliT0CalibAnalysisTask : public AliAnalysisTaskSE {
 
   Float_t famp[24];
   Float_t ftime[24];
-  Float_t fRawTime[24][5];
+  Float_t fRawTime[24];
   Bool_t fT0pileup[3];
   Int_t fMultiplicity;
   TObjString fTriggerinput ;
@@ -96,10 +88,6 @@ class AliT0CalibAnalysisTask : public AliAnalysisTaskSE {
   Int_t fTOFtracks;
   Float_t fT0tofTrack;
   AliESDpid* fESDpid;  //! esd pid
-
-  Double_t  fampfriend[24];  //from ESDfriend
-  Double_t ftimefriend[24]; //from ESDfriend
-  Double_t  fampledfriend[24]; //from ESDfriend
   
   AliT0CalibAnalysisTask(const AliT0CalibAnalysisTask&); // not implemented
   AliT0CalibAnalysisTask& operator=(const AliT0CalibAnalysisTask&); // not implemented