]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFClusterFinderV1.cxx
Add option to run on some local files with test mode using the alien plugin
[u/mrichter/AliRoot.git] / TOF / AliTOFClusterFinderV1.cxx
index 78aff2c9094febe34ee698ec1dbb065f7708006c..285a7230cef1d911b89d33679aac9ca4a73cfd5d 100644 (file)
@@ -60,6 +60,10 @@ Revision 0.01  2008/05/10 A. De Caro
 #include "AliTOFReconstructor.h"
 #include "AliTOFRecoParam.h"
 
+using std::endl;
+using std::cout;
+using std::ofstream;
+using std::ios;
 ClassImp(AliTOFClusterFinderV1)
 
 //_____________________________________________________________________________
@@ -70,6 +74,7 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliTOFcalib *calib):
   fRecPoints(new TClonesArray("AliTOFcluster", 4000)),
   fNumberOfTofClusters(0),
   fNumberOfTofDigits(0),
+  fNumberOfTofTrgPads(0),
   fkRecoParam(0),//AliTOFReconstructor::GetRecoParam()),
   fMaxDeltaTime(0),//fkRecoParam->GetMaxDeltaTime()),
   fVerbose(0),
@@ -111,6 +116,7 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(AliRunLoader* runLoader, AliTOFcali
   fRecPoints(new TClonesArray("AliTOFcluster", 4000)),
   fNumberOfTofClusters(0),
   fNumberOfTofDigits(0),
+  fNumberOfTofTrgPads(0),
   fkRecoParam(0),//AliTOFReconstructor::GetRecoParam()),
   fMaxDeltaTime(0),//fkRecoParam->GetMaxDeltaTime()),
   fVerbose(0),
@@ -152,6 +158,7 @@ AliTOFClusterFinderV1::AliTOFClusterFinderV1(const AliTOFClusterFinderV1 &source
    fRecPoints(source.fRecPoints),
    fNumberOfTofClusters(0),
    fNumberOfTofDigits(0),
+   fNumberOfTofTrgPads(0),
    fkRecoParam(0),//AliTOFReconstructor::GetRecoParam()),
    fMaxDeltaTime(0),//fkRecoParam->GetMaxDeltaTime()),
    fVerbose(0),
@@ -188,6 +195,9 @@ AliTOFClusterFinderV1& AliTOFClusterFinderV1::operator=(const AliTOFClusterFinde
   for (Int_t ii=0; ii<kTofMaxCluster; ii++) fTofClusters[ii]=source.fTofClusters[ii];
   fDigits=source.fDigits;
   fRecPoints=source.fRecPoints;
+  fNumberOfTofClusters=source.fNumberOfTofClusters;
+  fNumberOfTofTrgPads=source.fNumberOfTofTrgPads;
+  fNumberOfTofDigits=source.fNumberOfTofDigits;
   fVerbose=source.fVerbose;
   fDecoderVersion=source.fDecoderVersion;
   fTOFcalib=source.fTOFcalib;
@@ -248,6 +258,8 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr
 
   Int_t inholes = 0;
 
+  ResetRecpoint();
+
   fDigits->Clear();
   TClonesArray &aDigits = *fDigits;
 
@@ -344,7 +356,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(TTree* digitsTree, TTree* clusterTr
 
   AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters));
 
-  ResetRecpoint();
+//  ResetRecpoint();
 
   fTOFdigitMap->Clear();
 
@@ -367,6 +379,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(AliRawReader *rawReader, TTree *clu
   TStopwatch stopwatch;
   stopwatch.Start();
 
+  ResetRecpoint();
 
   AliDebug(2, "TreeD re-creation");
   //TTree *digitsTree = new TTree();
@@ -385,7 +398,7 @@ void AliTOFClusterFinderV1::Digits2RecPoints(AliRawReader *rawReader, TTree *clu
 
   AliDebug(1,Form("Number of found clusters: %d", fNumberOfTofClusters));
 
-  ResetRecpoint();
+//  ResetRecpoint();
 
   fTOFdigitMap->Clear();
 
@@ -481,6 +494,18 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre
       digit[2] = tofRawDatum->GetTOT();
       digit[3] = -1;//tofRawDatum->GetTOF(); //tofND
 
+      // noferini
+      Float_t pos[3];
+      AliTOFGeometry::GetPosPar(detectorIndex, pos);
+      Float_t length = 0.;
+      for (Int_t ic = 0; ic < 3; ic++) length += pos[ic] * pos[ic];
+      length = TMath::Sqrt(length);
+      Float_t timealligned = tdcCorr*24.4 - length * 0.0333564095198152043; // subtract the minimal time in
+      
+      if(status &&  timealligned > -1000 && timealligned < 24000){
+       fNumberOfTofTrgPads++;
+      }
+
       dummy = detectorIndex[3];
       detectorIndex[3] = detectorIndex[4];//padx
       detectorIndex[4] = dummy;//padz
@@ -499,6 +524,7 @@ void AliTOFClusterFinderV1::Raw2Digits(AliRawReader *rawReader, TTree* digitsTre
       last = fDigits->GetEntriesFast();
       new (aDigits[last]) AliTOFdigit(tracks, detectorIndex, digit);
       if (status) fTOFdigitMap->AddDigit(detectorIndex, last);
+      
 
       if (fVerbose==2) {
        if (indexDDL<10) ftxt << "  " << indexDDL;
@@ -3208,6 +3234,7 @@ void AliTOFClusterFinderV1::ResetRecpoint()
   //
 
   fNumberOfTofClusters = 0;
+  fNumberOfTofTrgPads = 0;
   if (fRecPoints) fRecPoints->Clear();
 
 }
@@ -3220,6 +3247,7 @@ void AliTOFClusterFinderV1::ResetDigits()
   //
 
   fNumberOfTofDigits = 0;
+  fNumberOfTofTrgPads = 0;
   if (fDigits) fDigits->Clear();
 
 }