]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - T0/AliT0Reconstructor.cxx
Added RuleChecker jars in trunk and updated CMake .pkg files
[u/mrichter/AliRoot.git] / T0 / AliT0Reconstructor.cxx
index 0c5b6019311564900b10338f2b21efb5be6c4d0a..3245a15c8b79fd5df2901502abbc9b7605b13425 100644 (file)
@@ -78,8 +78,6 @@ ClassImp(AliT0Reconstructor)
   if (!entry4) AliFatal("LHC clock-phase shift is not found in OCDB !");
   AliLHCClockPhase *phase = (AliLHCClockPhase*)entry4->GetObject();
 
-  printf("@@@@ GRP/Calib/LHCClockPhase %f\n",phase->GetMeanPhase());
-
   fGRPdelays = l1Delay - phase->GetMeanPhase();
 
   fParam = AliT0Parameters::Instance();
@@ -98,7 +96,7 @@ ClassImp(AliT0Reconstructor)
   fLatencyL1A = fParam->GetLatencyL1A();
   fLatencyL1C = fParam->GetLatencyL1C();
   fLatencyHPTDC = fParam->GetLatencyHPTDC();
-  AliDebug(0,Form(" LatencyL1 %f latencyL1A %f latencyL1C %f latencyHPTDC %f \n",fLatencyL1, fLatencyL1A, fLatencyL1C, fLatencyHPTDC));
+  AliDebug(2,Form(" LatencyL1 %f latencyL1A %f latencyL1C %f latencyHPTDC %f \n",fLatencyL1, fLatencyL1A, fLatencyL1C, fLatencyHPTDC));
   
   // fdZonC = TMath::Abs(fParam->GetZPositionShift("T0/C/PMT1"));
   //fdZonA = TMath::Abs(fParam->GetZPositionShift("T0/A/PMT15"));
@@ -161,7 +159,7 @@ void AliT0Reconstructor::Reconstruct(TTree*digitsTree, TTree*clustersTree) const
   Int_t pmtBestC=99999;
   
   AliT0RecPoint* frecpoints= new AliT0RecPoint ();
-  clustersTree->Branch( "T0", "AliT0RecPoint" ,&frecpoints, 405,1);
+  clustersTree->Branch( "T0", "AliT0RecPoint" ,&frecpoints);
   
   Float_t time[24], adc[24];
   for (Int_t ipmt=0; ipmt<24; ipmt++) {
@@ -261,7 +259,6 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
   Int_t refPoint = 0;
   //Bad channel
   Int_t badpmt = GetRecoParam()->GetRefPoint();
-  
   Int_t low[110], high[110];
 
   Int_t allData[110][5];
@@ -287,7 +284,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
    
   AliT0RecPoint* frecpoints= new AliT0RecPoint ();
   
-  recTree->Branch( "T0", "AliT0RecPoint" ,&frecpoints, 405,1);
+  recTree->Branch( "T0", "AliT0RecPoint" ,&frecpoints);
    
   AliDebug(10," before read data ");
   AliT0RawReader myrawreader(rawReader);
@@ -425,7 +422,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
        }
        fESDTZEROfriend->SetT0timeCorr(noncalibtime) ;     
        for (Int_t ipmt=0; ipmt<12; ipmt++){
-        if(time[ipmt] > 1 && ipmt != badpmt )
+        if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>0.1 )
           {
             if(time[ipmt]<besttimeC){
               besttimeC=time[ipmt]; //timeC
@@ -435,7 +432,7 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
        }
        for ( Int_t ipmt=12; ipmt<24; ipmt++)
         {
-          if(time[ipmt] > 1 && ipmt != badpmt)
+          if(time[ipmt] > 1 && ipmt != badpmt && adc[ipmt]>0.1)
             {
               if(time[ipmt]<besttimeA) {
                 besttimeA=time[ipmt]; //timeA
@@ -444,15 +441,14 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
             }
         }
        if(besttimeA < 999999) 
-        frecpoints->SetTimeBestA(besttimeA * channelWidth - 1000.*fLatencyHPTDC + 1000.*fLatencyL1A /*+ 1000.*fGRPdelays*/);
+        frecpoints->SetTimeBestA(besttimeA * channelWidth - 1000.*fLatencyHPTDC + 1000.*fLatencyL1A - 1000.*fGRPdelays);
        if( besttimeC < 999999 ) 
-        frecpoints->SetTimeBestC(besttimeC * channelWidth - 1000.*fLatencyHPTDC +1000.*fLatencyL1C/* + 1000.*fGRPdelays*/);
+        frecpoints->SetTimeBestC(besttimeC * channelWidth - 1000.*fLatencyHPTDC +1000.*fLatencyL1C - 1000.*fGRPdelays);
        AliDebug(10,Form(" pmtA %i besttimeA %f ps, pmtC %i besttimeC %f ps",
                       pmtBestA,besttimeA, pmtBestC,  besttimeC));
         if(besttimeA <999999 && besttimeC < 999999 ){
         timeDiff = ( besttimeA - besttimeC)* 0.001* channelWidth + fLatencyL1A - fLatencyL1C;
-        timeclock = channelWidth * Float_t( besttimeA+besttimeC)/2. - 1000.*fLatencyHPTDC + 1000.*fLatencyL1/* + 1000.*fGRPdelays*/;  
-        printf(" @@@ fGRPdelays %f\n",fGRPdelays);
+        timeclock = channelWidth * Float_t( besttimeA+besttimeC)/2. - 1000.*fLatencyHPTDC + 1000.*fLatencyL1 - 1000.*fGRPdelays;  
         meanTime = (besttimeA+besttimeC-2.*Float_t(ref))/2.;
         vertex =  meanVertex - c*(timeDiff)/2. ; //+ (fdZonA - fdZonC)/2; 
        }
@@ -511,7 +507,6 @@ void AliT0Reconstructor::Reconstruct(AliRawReader* rawReader, TTree*recTree) con
     //  cout<<"@@ spdver "<<spdver<<" ncont "<<ncont<<endl;
     if(ncont>2 ) {
       shift = currentVertex/c;
-      cout<<" @@@ vertex shif "<<shift<<" vertex "<<currentVertex<<endl;
     }
   }
   TTree *treeR = clustersTree;