]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
And some more cleanup
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Nov 2007 11:13:38 +0000 (11:13 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 30 Nov 2007 11:13:38 +0000 (11:13 +0000)
18 files changed:
TRD/AliTRDPreprocessor.cxx
TRD/AliTRDPreprocessor.h
TRD/AliTRDQAChecker.cxx
TRD/AliTRDQAChecker.h
TRD/AliTRDQADataMaker.cxx
TRD/AliTRDQADataMaker.h
TRD/AliTRDRawStream.cxx
TRD/AliTRDRawStream.h
TRD/AliTRDRecParam.h
TRD/AliTRDSignalIndex.cxx
TRD/AliTRDSignalIndex.h
TRD/AliTRDTriggerL1.cxx
TRD/AliTRDpidESD.cxx
TRD/AliTRDpidESD.h
TRD/AliTRDsimTR.cxx
TRD/AliTRDsimTR.h
TRD/AliTRDtransform.h
TRD/AliTRDtrigger.cxx

index fd6205c23d42ec64b9675538472f460a9745a7a7..4dbe0356c30ee225a171c3d336e9d2bab7821067 100644 (file)
@@ -31,8 +31,6 @@
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
-#include "AliTRDPreprocessor.h"
-
 #include <TFile.h>
 #include <TProfile2D.h>
 #include <TStopwatch.h>
@@ -44,6 +42,7 @@
 #include "AliCDBMetaData.h"
 #include "AliLog.h"
 
+#include "AliTRDPreprocessor.h"
 #include "AliTRDSensorArray.h"
 #include "AliTRDCalibraFit.h"
 #include "AliTRDCalibraMode.h"
@@ -55,8 +54,8 @@ ClassImp(AliTRDPreprocessor)
 
 //______________________________________________________________________________________________
 AliTRDPreprocessor::AliTRDPreprocessor(AliShuttleInterface *shuttle)
-  :AliPreprocessor("TRD", shuttle),
-   fVdriftHLT(0)
+  :AliPreprocessor("TRD", shuttle)
+  ,fVdriftHLT(0)
 {
   //
   // Constructor
@@ -99,8 +98,6 @@ UInt_t AliTRDPreprocessor::Process(TMap* dcsAliasMap)
     return 0;
   } 
 
-  
   if (runType=="PHYSICS"){
     // DCS
     if(ProcessDCS(dcsAliasMap)) return 1;
@@ -119,29 +116,37 @@ UInt_t AliTRDPreprocessor::Process(TMap* dcsAliasMap)
   return 0;  
   
 }
+
 //______________________________________________________________________________
 Bool_t AliTRDPreprocessor::ProcessDCS()
 {
+  //
+  // Default process DCS method
+  //
 
   TString runType = GetRunType();
-  if(runType == "PHYSICS") return kTRUE;
-
+  if (runType == "PHYSICS") {
+    return kTRUE;
+  }
   return kFALSE;
 
 }
 
 //______________________________________________________________________________
-Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
+Bool_t AliTRDPreprocessor::ProcessDCS(TMap *dcsAliasMap)
 {
-  Bool_t error=kFALSE;
+  //
+  // Process DCS method
+  //
+
+  Bool_t error = kFALSE;
 
   AliCDBMetaData metaData;
   metaData.SetBeamPeriod(0);
   metaData.SetResponsible("Wilfried Monange/Raphaelle Bailhache");
   metaData.SetComment("TRD calib test");
-       
-       
-  Log ("****** DCS ******\n");
+
+  Log("****** DCS ******\n");
        
   TObjArray * list=AliTRDSensorArray::GetList ();
        
@@ -164,7 +169,7 @@ Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
     oneTRDDCS->SetStartTime (TTimeStamp (fStartTime));
     oneTRDDCS->SetEndTime (TTimeStamp (fEndTime));
                        
-    Log (Form("Processing DCS : \"%s\"", oneTRDDCS->GetStoreName ().Data ()));
+    Log(Form("Processing DCS : \"%s\"", oneTRDDCS->GetStoreName ().Data ()));
                        
     TMap * map;
 
@@ -185,13 +190,11 @@ Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
 
     //results [iAlias] = StoreReferenceData("Calib", oneTRDDCS->GetStoreName ().Data (), oneTRDDCS, &metaData); 
 
-
     if (!results[iAlias]) {
       AliError("Problem during StoreRef DCS");
       error=kTRUE;
     }
 
-
     //BEGIN TEST (should not be removed ...)
     /*
     oneTRDDCS->ClearGraph();
@@ -224,8 +227,6 @@ Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
     */    
     //END TEST
 
-      
-      
   }
                
   Log ("         Summury of DCS :\n");
@@ -243,6 +244,7 @@ Bool_t AliTRDPreprocessor::ProcessDCS(TMap * dcsAliasMap)
   delete nGraph;
 
   return error;
+
 }
 
 //______________________________________________________________________________________________
@@ -269,8 +271,7 @@ Bool_t AliTRDPreprocessor::ExtractPedestals()
     return kTRUE;
   }
   
-  // loop through all files from LDCs
-  
+  // loop through all files from LDCs  
   UInt_t index = 0;
   while (listpad->At(index)!=NULL) {
     TObjString* fileNameEntry = (TObjString*) listpad->At(index);
@@ -328,16 +329,17 @@ Bool_t AliTRDPreprocessor::ExtractPedestals()
       } // fileNameEntry
     ++index;
   }// while (list)
+
   Log(Form("%d elements found in the list for the pedestal",(Int_t)index));
   if(index==0){
     delete listpad;
     return kTRUE;
   }
+
   //
   // Store pedestal entry to OCDB
   //
-  
-  
+    
   // Create Pad Status
   AliTRDCalPadStatus *calPadStatus = calPedSum.CreateCalPadStatus();
   AliCDBMetaData md3; 
@@ -381,6 +383,7 @@ Bool_t AliTRDPreprocessor::ExtractPedestals()
   return error; 
 
 }
+
 //______________________________________________________________________________________________
 Bool_t AliTRDPreprocessor::ExtractDriftVelocityDAQ()
 {
@@ -409,9 +412,6 @@ Bool_t AliTRDPreprocessor::ExtractDriftVelocityDAQ()
   md2.SetBeamPeriod(0);
   md2.SetComment("TRD calib test");
 
-
-
-
   // Take the file from the DAQ file exchange server
   TList *listdaq = GetFileSources(kDAQ,"VDRIFT");
   if (!listdaq) {
@@ -494,6 +494,7 @@ Bool_t AliTRDPreprocessor::ExtractDriftVelocityDAQ()
   return error; 
   
 }
+
 //______________________________________________________________________________________________
 Bool_t AliTRDPreprocessor::ExtractHLT()
 {
@@ -522,7 +523,6 @@ Bool_t AliTRDPreprocessor::ExtractHLT()
   md2.SetResponsible("Raphaelle Bailhache");
   md2.SetBeamPeriod(0);
   md2.SetComment("TRD calib test");
-
   
   // Take the file from the HLT file exchange server
   TList *listhlt = GetFileSources(kHLT,"GAINDRIFTPRF");
@@ -549,7 +549,6 @@ Bool_t AliTRDPreprocessor::ExtractHLT()
     // Take the file
     TFile *filehlt = TFile::Open(fileName);
     
-    
     // gain
     TH2I *histogain = (TH2I *) filehlt->Get("CH2d");
     histogain->SetDirectory(0);
@@ -587,8 +586,6 @@ Bool_t AliTRDPreprocessor::ExtractHLT()
       calibra->ResetVectorFit();
     }// if histogain
     
-    
-    
     // vdrift
     fVdriftHLT = kFALSE;
     TProfile2D *histodriftvelocity = (TProfile2D *) filehlt->Get("PH2d");
@@ -639,7 +636,6 @@ Bool_t AliTRDPreprocessor::ExtractHLT()
       calibra->ResetVectorFit();
     }// if TProfile2D
     
-    
     // prf
     TProfile2D *histoprf = (TProfile2D *) filehlt->Get("PRF2d");
     histoprf->SetDirectory(0);
index a1e59fa9b30674e77538f8705a7d7d97e5c1f9c1..21488757e6aa46793fcbd15432366eead9beffdd 100644 (file)
@@ -19,29 +19,28 @@ class TMap;
 class AliTRDPreprocessor : public AliPreprocessor
 {
 
 public:
+ public:
 
-    AliTRDPreprocessor(AliShuttleInterface *shuttle);
-    virtual ~AliTRDPreprocessor();
+  AliTRDPreprocessor(AliShuttleInterface *shuttle);
+  virtual ~AliTRDPreprocessor();
 
  protected:
 
-    virtual void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
-    virtual UInt_t Process(TMap *dcsAliasMap);
+  virtual void    Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
+  virtual UInt_t  Process(TMap *dcsAliasMap);
 
     
-    Bool_t  ExtractPedestals();
-    Bool_t  ExtractDriftVelocityDAQ();
-    Bool_t  ExtractHLT();
-    Bool_t  ProcessDCS();
-    Bool_t  ProcessDCS(TMap *dcsAliasMap);
+          Bool_t  ExtractPedestals();
+          Bool_t  ExtractDriftVelocityDAQ();
+          Bool_t  ExtractHLT();
+          Bool_t  ProcessDCS();
+          Bool_t  ProcessDCS(TMap *dcsAliasMap);
 
 private:
+ private:
 
-    Bool_t  fVdriftHLT;             // HLT Vdrift
+          Bool_t  fVdriftHLT;       // HLT Vdrift
 
-    ClassDef(AliTRDPreprocessor,1)  // The SHUTTLE preprocessor for TRD
+  ClassDef(AliTRDPreprocessor,1)    // The SHUTTLE preprocessor for TRD
 
 };
-
 #endif
index 418aca0138a72ea549b66d8f7b554fead82b78a8..f293e0bc8bfb2106331e6e2e8e1347cf3237f0f8 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-  Checks the quality assurance. 
-  By comparing with reference data
-  S.Radomski Uni-Heidelberg October 2007
-*/
+/* $Id$ */
+
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  Checks the quality assurance by comparing with reference data         //
+//                                                                        //
+//  Author:                                                               //
+//    Sylwester Radomski (radomski@physi.uni-heidelberg.de)               //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
 #include <TClass.h>
@@ -33,6 +38,7 @@
 #include "AliLog.h"
 #include "AliQA.h"
 #include "AliQAChecker.h"
+
 #include "AliTRDQAChecker.h"
 
 ClassImp(AliTRDQAChecker)
@@ -40,9 +46,13 @@ ClassImp(AliTRDQAChecker)
 //__________________________________________________________________
 AliTRDQAChecker& AliTRDQAChecker::operator = (const AliTRDQAChecker& qac )
 {
+  //
   // Equal operator.
+  //
+
   this->~AliTRDQAChecker();
   new(this) AliTRDQAChecker(qac);
   return *this;
+
 }
 
index 392ba9853ce9a865a793507cd7e528550065f790..022765a744ecc50aa58e1cd1f2f35c223b7ef23d 100644 (file)
@@ -1,14 +1,18 @@
-#ifndef ALITRDQUALASSCHECKER_H
-#define ALITRDQUALASSCHECKER_H
+#ifndef ALITRDQACHECKER_H
+#define ALITRDQACHECKER_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/*
-  Checks the quality assurance. 
-  By comparing with reference data
-  S. Radomski Uni-Heidelberg October 2007
-*/
+/* $Id$ */
 
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  Checks the quality assurance by comparing with reference data         //
+//                                                                        //
+//  Author:                                                               //
+//    Sylwester Radomski (radomski@physi.uni-heidelberg.de)               //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
 class TFile ; 
@@ -19,20 +23,21 @@ class TH1I ;
 
 // --- AliRoot header files ---
 #include "AliQACheckerBase.h"
+
 class AliTRDLoader ; 
 
 class AliTRDQAChecker: public AliQACheckerBase {
 
-public:
-  AliTRDQAChecker() : AliQACheckerBase("TRD","TRD Quality Assurance Data Maker") {;}          // ctor
-  AliTRDQAChecker(const AliTRDQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor   
+ public:
+
+  AliTRDQAChecker() : AliQACheckerBase("TRD","TRD Quality Assurance Data Maker") {;} 
+  AliTRDQAChecker(const AliTRDQAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} 
   AliTRDQAChecker& operator = (const AliTRDQAChecker& qac) ;
-  virtual ~AliTRDQAChecker() {;} // dtor
+  virtual ~AliTRDQAChecker() {;} 
 
 private:
   
-  ClassDef(AliTRDQAChecker,1)  // description 
+  ClassDef(AliTRDQAChecker,1)  // TRD QA checker
 
 };
-
-#endif // AliTRDQAChecker_H
+#endif
index 24c7601ce7f6567832eff11054429a32d8c0d9f2..e879ae0e3dd1721e6b5823478abf10390696e676 100644 (file)
 
 ////////////////////////////////////////////////////////////////////////////
 //                                                                        //
-// Produces the data needed to calculate the quality assurance.           //
-// All data must be mergeable objects.                                    //
-// S.Radomski Uni-Heidelberg October 2007                                 //
+//  Produces the data needed to calculate the quality assurance.          //
+//  All data must be mergeable objects.                                   //
+//                                                                        //
+//  Author:                                                               //
+//    Sylwester Radomski (radomski@physi.uni-heidelberg.de)               //
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
 ClassImp(AliTRDQADataMaker)
            
 //____________________________________________________________________________ 
-  AliTRDQADataMaker::AliTRDQADataMaker() : 
-  AliQADataMaker(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
+AliTRDQADataMaker::AliTRDQADataMaker() 
+  :AliQADataMaker(AliQA::GetDetName(AliQA::kTRD), "TRD Quality Assurance Data Maker")
 {
-  // ctor
+  //
+  // Default constructor
+  //
+
 }
 
 //____________________________________________________________________________ 
-AliTRDQADataMaker::AliTRDQADataMaker(const AliTRDQADataMaker& qadm) :
-  AliQADataMaker()
+AliTRDQADataMaker::AliTRDQADataMaker(const AliTRDQADataMaker& qadm)
+  :AliQADataMaker()
 {
-  //copy ctor 
+  //
+  // Copy constructor
+  //
   SetName((const char*)qadm.GetName()) ; 
   SetTitle((const char*)qadm.GetTitle()); 
+
 }
 
 //__________________________________________________________________
 AliTRDQADataMaker& AliTRDQADataMaker::operator = (const AliTRDQADataMaker& qadm )
 {
+  //
   // Equal operator.
+  //
+
   this->~AliTRDQADataMaker();
   new(this) AliTRDQADataMaker(qadm);
   return *this;
+
 }
  
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::EndOfDetectorCycle()
 {
-  //Detector specific actions at end of cycle
-
-  // Rec points
+  //
+  // Detector specific actions at end of cycle
+  //
   
 }
 
@@ -82,11 +95,11 @@ void AliTRDQADataMaker::EndOfDetectorCycle()
 void AliTRDQADataMaker::InitESDs()
 {
   //
-  // create ESDs histograms in ESDs subdir
+  // Create ESDs histograms in ESDs subdir
   //
 
-  const Int_t nhist = 21;
-  TH1 *hist[nhist];
+  const Int_t kNhist = 21;
+  TH1 *hist[kNhist];
   Int_t histoCounter = -1 ;   
 
   hist[++histoCounter] = new TH1D("qaTRD_esd_ntracks", ":Number of tracks", 300, -0.5, 299.5);
@@ -114,14 +127,18 @@ void AliTRDQADataMaker::InitESDs()
     //hist[i]->Sumw2();
     Add2ESDsList(hist[i], i);
   }
+
 }
 
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::InitHits()
 {
-  // create Hits histograms in Hits subdir
-  const Int_t nhist = 4;
-  TH1D *hist[nhist];
+  //
+  // Create Hits histograms in Hits subdir
+  //
+
+  const Int_t kNhist = 4;
+  TH1D *hist[kNhist];
   
   hist[0] = new TH1D("qaTRD_hits_det", ";Detector Id of the hit", 540, -0.5, 539.5) ; 
   
@@ -129,25 +146,28 @@ void AliTRDQADataMaker::InitHits()
   hist[2] = new TH1D("qaTRD_hist_Qamp", ";Charge from TRD photon", 100, 0, 100);
   hist[3] = new TH1D("qaTRD_hist_Qphoton", ";Charge from TRD photon", 100, 0, 100);
 
-  for(Int_t i=0; i<nhist; i++) {
+  for(Int_t i=0; i<kNhist; i++) {
     //hist[i]->Sumw2();
     Add2HitsList(hist[i], i);
   }
+
 }
 
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::InitDigits()
 {
-  // create Digits histograms in Digits subdir
-  
-  const Int_t nhist = 3;
-  TH1D *hist[nhist];
+  //
+  // Create Digits histograms in Digits subdir
+  //
+
+  const Int_t kNhist = 3;
+  TH1D *hist[kNhist];
   
   hist[0] = new TH1D("qaTRD_digits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
   hist[1] = new TH1D("qaTRD_digits_time", ";Time bin", 40, -0.5, 39.5);
   hist[2] = new TH1D("qaTRD_digits_amp", ";Amplitude", 100, 0, 100.);
 
-  for(Int_t i=0; i<nhist; i++) {
+  for(Int_t i=0; i<kNhist; i++) {
     hist[i]->Sumw2();
     Add2DigitsList(hist[i], i);
   }
@@ -157,9 +177,12 @@ void AliTRDQADataMaker::InitDigits()
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::InitRecPoints()
 {
-  // create Reconstructed Points histograms in RecPoints subdir
-  const Int_t nhist = 12;
-  TH1 *hist[nhist];
+  //
+  // Create Reconstructed Points histograms in RecPoints subdir
+  //
+
+  const Int_t kNhist = 12;
+  TH1 *hist[kNhist];
 
   hist[0] = new TH1D("qaTRD_recPoints_det", ";Detector ID of the cluster", 540, -0.5, 539.5);
   hist[1] = new TH2D("qaTRD_recPoints_amp", ";Amplitude", 540, -0.5, 539, 200, -0.5, 199.5);
@@ -180,19 +203,23 @@ void AliTRDQADataMaker::InitRecPoints()
   hist[12] = new TH1D("qaTRD_recPoints_ampDist", ";amplitude MPV", 100, 0, 100);
 
 
-  for(Int_t i=0; i<nhist; i++) {
+  for(Int_t i=0; i<kNhist; i++) {
     //hist[i]->Sumw2();
     Add2RecPointsList(hist[i], i);
   }
+
 }
 
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::InitRaws()
 {
-  // create Raws histograms in Raws subdir
+  //
+  // Create Raws histograms in Raws subdir
+  //
+
   const Int_t kSM = 18;
-  const Int_t nhist = 6+kSM;
-  TH1D *hist[nhist];
+  const Int_t kNhist = 6+kSM;
+  TH1D *hist[kNhist];
  
   hist[0] = new TH1D("qaTRD_raws_det", ";detector", 540, -0.5, 539.5);
   hist[1] = new TH1D("qaTRD_raws_sig", ";signal", 100, -0.5, 99.5);
@@ -202,38 +229,45 @@ void AliTRDQADataMaker::InitRaws()
   hist[5] = new TH1D("qaTRD_rows_smId", ";supermodule", 18, -0.5, 17.5);
 
   // one char per ADC chanell
-  const Int_t nADC = 30 * 8 * 16 * 22;
+  const Int_t kNADC = 30 * 8 * 16 * 22;
   for(Int_t i=0; i<kSM; i++)
-    hist[6+i] = new TH1D(Form("qaTRD_raws_sm%d",i),"",nADC, -0.5, nADC-0.5); 
+    hist[6+i] = new TH1D(Form("qaTRD_raws_sm%d",i),"",kNADC, -0.5, kNADC-0.5); 
 
-  for(Int_t i=0; i<nhist; i++) {
+  for(Int_t i=0; i<kNhist; i++) {
     //hist[i]->Sumw2();
     Add2RawsList(hist[i], i);
   }
+
 }
 
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::InitSDigits()
 {
-  // create SDigits histograms in SDigits subdir
-  
-  const Int_t nhist = 3;
-  TH1D *hist[nhist];
+  //
+  // Create SDigits histograms in SDigits subdir
+  //
+
+  const Int_t kNhist = 3;
+  TH1D *hist[kNhist];
   
   hist[0] = new TH1D("qaTRD_sdigits_det", ";Detector Id of the digit", 540, -0.5, 539.5);
   hist[1] = new TH1D("qaTRD_sdigits_time", ";Time bin", 40, -0.5, 39.5);
   hist[2] = new TH1D("qaTRD_sdigits_amp", ";Amplitude", 100, 0, 1e7);
 
-  for(Int_t i=0; i<nhist; i++) {
+  for(Int_t i=0; i<kNhist; i++) {
     hist[i]->Sumw2();
     Add2SDigitsList(hist[i], i);
   }
+
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeESDs(AliESDEvent * esd)
 {
-  // make QA data from ESDs
+  //
+  // Make QA data from ESDs
+  //
+
   Int_t nTracks = esd->GetNumberOfTracks();
   GetESDsData(0)->Fill(nTracks);
   
@@ -332,42 +366,46 @@ void AliTRDQADataMaker::MakeESDs(AliESDEvent * esd)
     
   }
 
-
-
 }
 
 //______________________________________________________________________________
-Int_t AliTRDQADataMaker::GetSector(const Double_t alpha) const {
+Int_t AliTRDQADataMaker::GetSector(const Double_t alpha) const 
+{
+  //
   // Gets the sector number 
+  //
 
   Double_t size = TMath::DegToRad() * 20.; // shall use TRDgeo
   Int_t sector = (Int_t)((alpha + TMath::Pi())/size);
   return sector;
+
 }
 
 //______________________________________________________________________________
-Double_t AliTRDQADataMaker::GetExtZ(const AliExternalTrackParam *in) const {
+Double_t AliTRDQADataMaker::GetExtZ(const AliExternalTrackParam *in) const 
+{
   //
-  // returns the Z position at the entry to TRD
+  // Returns the Z position at the entry to TRD
   // using parameters from the TPC in
   //
 
-  const Double_t x0 = 300;
+  const Double_t kX0 = 300;
 
   Double_t x = in->GetX();
   const Double_t *par = in->GetParameter();
   Double_t theta = par[3];
   Double_t z = in->GetZ();
   
-  Double_t zz = z + (x0-x) * TMath::Tan(theta);
+  Double_t zz = z + (kX0-x) * TMath::Tan(theta);
   return zz;
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeHits(TClonesArray * hits)
 {
-  //make QA data from Hits
-  //printf("making QA for TRD hits from an array %d\n", hits->GetEntriesFast());
+  //
+  // Make QA data from Hits
+  //
 
   TIter next(hits); 
   AliTRDhit * hit; 
@@ -386,8 +424,9 @@ void AliTRDQADataMaker::MakeHits(TClonesArray * hits)
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeHits(TTree * hitTree)
 {
-  //make QA data from Hits
-  //printf("making QA for TRD hits from a tree\n");
+  //
+  // Make QA data from Hits
+  //
   
   if (!CheckPointer(hitTree, "TRD hits tree")) return;
  
@@ -413,25 +452,32 @@ void AliTRDQADataMaker::MakeHits(TTree * hitTree)
   tmp->Delete();
   delete tmp;
   MakeHits(hits);
+
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeDigits(TClonesArray * digits)
 {
-  // makes data from Digits
-  
+  //
+  // Makes data from digits
+  //
+
   TIter next(digits) ; 
   AliTRDdigit * digit ; 
   while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
     GetDigitsData(0)->Fill(digit->GetDetector());
     GetDigitsData(1)->Fill(digit->GetTime());
     GetDigitsData(2)->Fill(digit->GetAmp());
-  }  
+  }
+
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeDigits(TTree * digits)
 {
+  //
+  // Makes data from digits tree
+  //
 
   AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
   digitsManager->CreateArrays();
@@ -465,26 +511,34 @@ void AliTRDQADataMaker::MakeDigits(TTree * digits)
     
     //delete digitsIn;
   }
+
   delete digitsManager;
+
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeSDigits(TClonesArray * sdigits)
 {
-  // makes data from Digits
-  
+  //
+  // Makes data from digits
+  //
+
   TIter next(sdigits) ; 
   AliTRDdigit * digit ; 
   while ( (digit = dynamic_cast<AliTRDdigit *>(next())) ) {
     GetDigitsData(0)->Fill(digit->GetDetector());
     GetDigitsData(1)->Fill(digit->GetTime());
     GetDigitsData(2)->Fill(digit->GetAmp());
-  }  
+  } 
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeSDigits(TTree * digits)
 {
+  //
+  // Makes data from digits tree
+  //
 
   AliTRDdigitsManager *digitsManager = new AliTRDdigitsManager();
   digitsManager->CreateArrays();
@@ -521,13 +575,16 @@ void AliTRDQADataMaker::MakeSDigits(TTree * digits)
   }
 
   delete digitsManager;
+
 }
 
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeRaws(AliRawReader* rawReader)
 {
+  //
   // 157
   // T9 -- T10
+  //
 
   //const Int_t kSM  = 18;
   //const Int_t kROC = 30;
@@ -572,8 +629,8 @@ void AliTRDQADataMaker::MakeRaws(AliRawReader* rawReader)
 //____________________________________________________________________________
 void AliTRDQADataMaker::MakeRecPoints(TTree * clustersTree)
 {
-  
-  // makes data from RecPoints
+  //  
+  // Makes data from RecPoints
   // 
   
   Int_t nsize = Int_t(clustersTree->GetTotBytes() / (sizeof(AliTRDcluster))); 
@@ -640,21 +697,27 @@ void AliTRDQADataMaker::MakeRecPoints(TTree * clustersTree)
   for(Int_t i=0; i<540; i++) 
     if (nDet[i] > 0) GetRecPointsData(9)->Fill(nDet[i]);
 
-
   delete clusterArray;
+
 }
 
 //____________________________________________________________________________ 
 void AliTRDQADataMaker::StartOfDetectorCycle()
 {
-  //Detector specific actions at start of cycle
+  //
+  // Detector specific actions at start of cycle
+  //
 
 }
 
 //__________________________________________________________________________
-Int_t AliTRDQADataMaker::CheckPointer(TObject *obj, const char *name) {
+Int_t AliTRDQADataMaker::CheckPointer(TObject *obj, const char *name) 
+{
+  //
+  // Checks initialization of pointers
+  //
 
   if (!obj) AliWarning(Form("null pointer: %s", name));
   return !!obj;
+
 }
-//__________________________________________________________________________
index b9b329b551d33495c73debdbd88adebde11dc052..3eb198463efceaaf8cadfef108fb5d099a178997 100644 (file)
@@ -7,9 +7,11 @@
 
 ////////////////////////////////////////////////////////////////////////////
 //                                                                        //
-// Produces the data needed to calculate the quality assurance.           //
-// All data must be mergeable objects.                                    //
-// S.Radomski Uni-Heidelberg October 2007                                 //
+//  Produces the data needed to calculate the quality assurance.          //
+//  All data must be mergeable objects.                                   //
+//                                                                        //
+//  Author:                                                               //
+//    Sylwester Radomski (radomski@physi.uni-heidelberg.de)               //
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
@@ -24,14 +26,14 @@ class AliExternalTrackParam;
 
 class AliTRDQADataMaker: public AliQADataMaker {
 
-public:
+ public:
 
   AliTRDQADataMaker() ;          // ctor
   AliTRDQADataMaker(const AliTRDQADataMaker& qadm) ;   
   AliTRDQADataMaker& operator = (const AliTRDQADataMaker& qadm) ;
   virtual ~AliTRDQADataMaker() {;} // dtor
   
-private:
+ private:
 
   virtual void EndOfDetectorCycle(AliQA::TASKINDEX, TList*) {};
   virtual void EndOfDetectorCycle() ;
@@ -62,8 +64,7 @@ private:
   Int_t    GetSector(const Double_t alpha) const;
   Double_t GetExtZ(const AliExternalTrackParam *paramIn) const;
 
-  ClassDef(AliTRDQADataMaker,1)  // description 
+  ClassDef(AliTRDQADataMaker,1)  // Creates the TRD QA data
 
 };
-
-#endif // AliTRDQADATAMAKER_H
+#endif
index 460508d27164bf1b9cc779c78418bb2d1fb43e1a..d23ed07bd3bcf5bd8bc18fd840162115162c8ba4 100644 (file)
 
 /* $Id$ */
 
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-// This class provides access to TRD digits in raw data.                     //
-//                                                                           //
-// It loops over all TRD digits in the raw data given by the AliRawReader.   //
-// The Next method goes to the next digit. If there are no digits left       //
-// it returns kFALSE.                                                        //
-// Several getters provide information about the current digit.              //
-//                                                                           //
-// Author: C. Lippmann (C.Lippmann@gsi.de)                                   //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// This class provides access to TRD digits in raw data.                  //
+//                                                                        //
+// It loops over all TRD digits in the raw data given by the AliRawReader //
+// The Next method goes to the next digit. If there are no digits left    //
+// it returns kFALSE.                                                     //
+// Several getters provide information about the current digit.           //
+//                                                                        //
+// Author:                                                                //
+//   Christian Lippmann (C.Lippmann@gsi.de)                               //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include "AliLog.h"
 #include "AliRawReader.h"
+
 #include "AliTRDRawStream.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDcalibDB.h"
-
 #include "AliTRDdigitsManager.h"
 #include "AliTRDdataArrayI.h"
 #include "AliTRDSignalIndex.h"
-
 #include "AliTRDfeeParam.h"
+
 ClassImp(AliTRDRawStream)
 
 //_____________________________________________________________________________
 AliTRDRawStream::AliTRDRawStream() 
   :TObject()
+  ,fGeo(NULL) 
   ,fSig()
   ,fADC(0)
   ,fTB(0)
@@ -104,11 +106,10 @@ AliTRDRawStream::AliTRDRawStream()
   ,fSizeOK(kFALSE)
   ,fCountBytes(0)
   ,fBufSize(0)
-  ,fkBufferSet(kFALSE)
+  ,fBufferSet(kFALSE)
   ,fPos(NULL)
   ,fDataWord(NULL)
   ,fTimeBinsCalib(0)
-  ,fGeo(NULL) 
 {
   //
   // Default constructor
@@ -123,6 +124,7 @@ AliTRDRawStream::AliTRDRawStream()
 //_____________________________________________________________________________
 AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader) 
   :TObject()
+  ,fGeo(NULL) 
   ,fSig()
   ,fADC(0)
   ,fTB(0)
@@ -183,11 +185,10 @@ AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader)
   ,fSizeOK(kFALSE)
   ,fCountBytes(0)
   ,fBufSize(0)
-  ,fkBufferSet(kFALSE)
+  ,fBufferSet(kFALSE)
   ,fPos(NULL)
   ,fDataWord(NULL)
   ,fTimeBinsCalib(0)
-  ,fGeo(NULL) 
 {
   //
   // Create an object to read TRD raw digits
@@ -204,6 +205,7 @@ AliTRDRawStream::AliTRDRawStream(AliRawReader *rawReader)
 //_____________________________________________________________________________
 AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream)
   :TObject(stream)
+  ,fGeo(NULL)
   ,fSig()
   ,fADC(-1)
   ,fTB(-1)
@@ -264,11 +266,10 @@ AliTRDRawStream::AliTRDRawStream(const AliTRDRawStream& stream)
   ,fSizeOK(kFALSE)
   ,fCountBytes(0)
   ,fBufSize(0)
-  ,fkBufferSet(kFALSE)
+  ,fBufferSet(kFALSE)
   ,fPos(NULL)
   ,fDataWord(NULL)
   ,fTimeBinsCalib(0)
-  ,fGeo(NULL)
 {
   //
   // Copy constructor
@@ -286,7 +287,7 @@ AliTRDRawStream& AliTRDRawStream::operator = (const AliTRDRawStream&
   // Assigment operator
   //
 
-  Fatal("operator =", "assignment operator not implemented");
+  AliFatal("Assignment operator not implemented");
   return *this;
 
 }
@@ -307,10 +308,15 @@ AliTRDRawStream::~AliTRDRawStream()
 //_____________________________________________________________________________
 void AliTRDRawStream::SetRawReader(AliRawReader *rawReader) 
 {
+  //
+  // Sets the raw reader
+  //
+
   if (rawReader)
     {
       fRawReader = rawReader;
     }
+
 }
 
 //_____________________________________________________________________________
@@ -329,7 +335,6 @@ Bool_t AliTRDRawStream::SetRawVersion(Int_t rv)
 
 }
 
-
 //____________________________________________________________________________
 Int_t AliTRDRawStream::Init()
 {
@@ -369,15 +374,17 @@ Int_t AliTRDRawStream::Init()
   fDataSize = 0;
   fSizeOK = kFALSE;
   
-  fNextStatus = fkStart;
+  fNextStatus = kStart;
 
   fCountBytes = 0;
   fBufSize = 0;
   fDataWord = NULL;
   fPos = NULL;
   fWordCtr = 0;
-  fkBufferSet = kFALSE;
+  fBufferSet = kFALSE;
+
   return kTRUE;
+
 }
 
 //____________________________________________________________________________
@@ -389,20 +396,20 @@ Int_t AliTRDRawStream::NextData()
 
   if (fCountBytes + kSizeWord >= fBufSize)
     {
-      fkBufferSet = fRawReader->ReadNextData(fPos);
-      if (fkBufferSet == kTRUE)
+      fBufferSet = fRawReader->ReadNextData(fPos);
+      if (fBufferSet == kTRUE)
        {
          fBufSize = fRawReader->GetDataSize();
          fCountBytes = 0;        
          fDataWord = (UInt_t*)fPos;
-         fNextStatus = fkNextSM;
+         fNextStatus = kNextSM;
          fWordCtr = 0;
-         return fkNextSM;
+         return kNextSM;
        }
       else
        {
-         fNextStatus = fkStop;
-         return fkNoMoreData;
+         fNextStatus = kStop;
+         return kNoMoreData;
        }
     }
   else
@@ -412,7 +419,7 @@ Int_t AliTRDRawStream::NextData()
       fCountBytes += kSizeWord;          
       fDataWord = (UInt_t*)fPos;
       fWordCtr++;
-      return fkWordOK;
+      return kWordOK;
     }
 }
 
@@ -423,15 +430,15 @@ Bool_t AliTRDRawStream::Next()
   // Updates the next data word pointer
   //
 
-  if (fNextStatus == fkStart)
+  if (fNextStatus == kStart)
     {
       Init();
     }
 
-  while (fNextStatus != fkStop)
-    { // !fkStop
+  while (fNextStatus != kStop)
+    { // !kStop
       NextData();
-      if (fNextStatus == fkNextMCM || fNextStatus == fkNextData)
+      if (fNextStatus == kNextMCM || fNextStatus == kNextData)
        {
          fHCdataCtr += 4;
          
@@ -442,24 +449,24 @@ Bool_t AliTRDRawStream::Next()
                {
                  AliWarning("Wrong fMCM or fROB. Skip this data");
                  fRawReader->AddMajorErrorLog(kWrongMCMorROB,Form("MCM=%d, ROB=%d",fMCM,fROB));
-                 fNextStatus = fkNextHC;
+                 fNextStatus = kNextHC;
                  continue;
                }
              fTbSwitch    = 3;  // For first adc channel we expect: (*fDataWord & 3) = 3
              fTbSwitchCtr = 0;  // 
              fADC = fTB   = 0;  // Reset Counter
-             fNextStatus = fkNextData;
+             fNextStatus = kNextData;
              continue;
            }
          
          if ( *fDataWord == kEndofrawdatamarker ) 
            {  // End of half-chamber data, finished
              fGTUctr1 = -1;
-             fNextStatus = fkNextHC;
+             fNextStatus = kNextHC;
              continue;
            }
          
-         if (fNextStatus == fkNextData )
+         if (fNextStatus == kNextData )
            {       // MCM header is set, ADC data is valid.
              
              // Found some data. Decode it now:
@@ -467,7 +474,7 @@ Bool_t AliTRDRawStream::Next()
              if ( fRetVal ==  0 ) continue;
              if ( fRetVal == -1 ) 
                {
-                 fNextStatus = fkNextHC;
+                 fNextStatus = kNextHC;
                  continue;
                }
              if ( fRetVal == 1)
@@ -491,12 +498,12 @@ Bool_t AliTRDRawStream::Next()
              //              {
              //                fCOL = -1;             
              //              }
-           }// fkNextData  
+           }// kNextData  
          
          continue;
        } //next mcm
 
-      if ( fNextStatus == fkNextHC )
+      if ( fNextStatus == kNextHC )
        {
          //
          // 1) Find end_of_tracklet_marker
@@ -512,7 +519,7 @@ Bool_t AliTRDRawStream::Next()
          if ( *fDataWord == kEndoftrackletmarker ) 
            {
              AliDebug(3, "end-of-tracklet-marker found");
-             fNextStatus = fkSeekNonEoTracklet;
+             fNextStatus = kSeekNonEoTracklet;
              continue;
            } 
          else 
@@ -524,7 +531,7 @@ Bool_t AliTRDRawStream::Next()
            }
        } //if next HC
 
-      if (fNextStatus == fkSeekNonEoTracklet)
+      if (fNextStatus == kSeekNonEoTracklet)
        {
          //
          // 2) Look for non-end_of_tracklet_marker
@@ -533,7 +540,7 @@ Bool_t AliTRDRawStream::Next()
 
          if ( *fDataWord != kEndoftrackletmarker ) 
            {
-             fNextStatus = fkDecodeHC;
+             fNextStatus = kDecodeHC;
              AliDebug(3, "NON end-of-tracklet-marker found");
              //// no do not continue - this should be the hcheader
            }
@@ -544,7 +551,7 @@ Bool_t AliTRDRawStream::Next()
            }
        }
 
-      if ( fNextStatus == fkDecodeHC )
+      if ( fNextStatus == kDecodeHC )
        {
          AliDebug(3, "Decode HC");
 
@@ -563,19 +570,19 @@ Bool_t AliTRDRawStream::Next()
              fHCdataCtr = 0;
              
              fChamberDone[fDET]++;
-             fNextStatus = fkNextMCM;
+             fNextStatus = kNextMCM;
              AliDebug(3, "Decode HC OK");            
              continue;
            } //HC header
          else
            {
              AliDebug(3, "Decode HC NOT OK");        
-             fNextStatus = fkNextSM;
+             fNextStatus = kNextSM;
              continue;
            }
        } // if decode HC
 
-      if (fNextStatus == fkNextSM)
+      if (fNextStatus == kNextSM)
        {
          
          fDET     = 0;
@@ -596,18 +603,18 @@ Bool_t AliTRDRawStream::Next()
          if ( (*fDataWord & 0xfffff000) ==  0xe0000000 ) 
            {
              DecodeGTUlinkMask();
-             fNextStatus = fkNextHC;
+             fNextStatus = kNextHC;
              continue;
            } 
          else 
            {
              AliWarning(Form("Equipment %d: First data word is not GTU Link Mask!", fEqID));
               fRawReader->AddMajorErrorLog(kGTULinkMaskMissing,Form("Equipment %d",fEqID));
-             fNextStatus = fkStop;
+             fNextStatus = kStop;
            }       
        }// if nextSM
 
-    } // not fkStop
+    } // not kStop
 
   AliDebug(1, Form("That's all folks! %d", fSM));
   return kFALSE;
@@ -626,16 +633,16 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
   AliTRDdataArrayI *track2 = 0; 
   AliTRDSignalIndex *indexes = 0;
          
-  if (fNextStatus == fkStart)
+  if (fNextStatus == kStart)
     {
       Init();
     }
 
-  while (fNextStatus != fkStop)
-    { // !fkStop
+  while (fNextStatus != kStop)
+    { // !kStop
       NextData();
-      if (fNextStatus == fkNextMCM || fNextStatus == fkNextData)
-      //while (fNextStatus == fkNextMCM || fNextStatus == fkNextData)
+      if (fNextStatus == kNextMCM || fNextStatus == kNextData)
+      //while (fNextStatus == kNextMCM || fNextStatus == kNextData)
        {
          fHCdataCtr += 4;
          
@@ -646,13 +653,13 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
                {
                  AliWarning("Wrong fMCM or fROB. Skip this data");
                  fRawReader->AddMajorErrorLog(kWrongMCMorROB,Form("MCM=%d, ROB=%d",fMCM,fROB));
-                 fNextStatus = fkNextHC;
+                 fNextStatus = kNextHC;
                  continue;
                }
              fTbSwitch    = 3;  // For first adc channel we expect: (*fDataWord & 3) = 3
              fTbSwitchCtr = 0;  // 
              fADC = fTB   = 0;  // Reset Counter
-             fNextStatus = fkNextData;
+             fNextStatus  = kNextData;
 
 //           NextData(); // if while loop!
              continue; // if if
@@ -661,7 +668,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
          if ( *fDataWord == kEndofrawdatamarker ) 
            {  // End of half-chamber data, finished
              fGTUctr1 = -1;
-             fNextStatus = fkNextHC;
+             fNextStatus = kNextHC;
              // full chamber processed ?
              if (fChamberDone[fDET] == 2)
                {
@@ -674,7 +681,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
                }
            }
          
-         if (fNextStatus == fkNextData )
+         if (fNextStatus == kNextData )
            {       // MCM header is set, ADC data is valid.
              
              // Found some data. Decode it now:
@@ -682,7 +689,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
              if ( fRetVal ==  0 ) continue;
              if ( fRetVal == -1 ) 
                {
-                 fNextStatus = fkNextHC;
+                 fNextStatus = kNextHC;
 
 //               NextData(); // if while loop!
 //               break; //if while loop!
@@ -729,13 +736,13 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
 //           {
 //             fCOL = -1;             
 //           }
-           }// fkNextData  
+           }// kNextData  
          
 //       NextData(); // if while loop!
          continue; //if if
        } //next mcm
 
-      if ( fNextStatus == fkNextHC )
+      if ( fNextStatus == kNextHC )
        {
          //
          // 1) Find end_of_tracklet_marker
@@ -751,7 +758,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
          if ( *fDataWord == kEndoftrackletmarker ) 
            {
              AliDebug(3, "end-of-tracklet-marker found");
-             fNextStatus = fkSeekNonEoTracklet;
+             fNextStatus = kSeekNonEoTracklet;
              continue;
            } 
          else 
@@ -763,7 +770,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
            }
        } //if next HC
 
-      if (fNextStatus == fkSeekNonEoTracklet)
+      if (fNextStatus == kSeekNonEoTracklet)
        {
          //
          // 2) Look for non-end_of_tracklet_marker
@@ -772,7 +779,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
 
          if ( *fDataWord != kEndoftrackletmarker ) 
            {
-             fNextStatus = fkDecodeHC;
+             fNextStatus = kDecodeHC;
              AliDebug(3, "NON end-of-tracklet-marker found");
              //// no do not continue - this should be the hcheader
            }
@@ -783,7 +790,7 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
            }
        }
 
-      if ( fNextStatus == fkDecodeHC )
+      if ( fNextStatus == kDecodeHC )
        {
          AliDebug(3, "Decode HC");
 
@@ -839,19 +846,19 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
              fHCdataCtr = 0;
              
              fChamberDone[fDET]++;
-             fNextStatus = fkNextMCM;
+             fNextStatus = kNextMCM;
              AliDebug(3, "Decode HC OK");            
              continue;
            } //HC header
          else
            {
              AliDebug(3, "Decode HC NOT OK");        
-             fNextStatus = fkNextSM;
+             fNextStatus = kNextSM;
              continue;
            }
        } // if decode HC
 
-      if (fNextStatus == fkNextSM)
+      if (fNextStatus == kNextSM)
        {
          
          fDET     = 0;
@@ -872,18 +879,18 @@ Int_t AliTRDRawStream::NextChamber(AliTRDdigitsManager *man)
          if ( (*fDataWord & 0xfffff000) ==  0xe0000000 ) 
            {
              DecodeGTUlinkMask();
-             fNextStatus = fkNextHC;
+             fNextStatus = kNextHC;
              continue;
            } 
          else 
            {
              AliWarning(Form("Equipment %d: First data word is not GTU Link Mask!", fEqID));
               fRawReader->AddMajorErrorLog(kGTULinkMaskMissing,Form("Equipment %d",fEqID));
-             fNextStatus = fkStop;
+             fNextStatus = kStop;
            }       
        }// if nextSM
 
-    } // not fkStop
+    } // not kStop
 
   AliDebug(1, Form("That's all folks! %d", fSM));
   //return kFALSE;
@@ -963,11 +970,11 @@ void AliTRDRawStream::DecodeHCheader(Int_t timeBins)
   // 2nd word (h[1])
   if ( fHCHWords >= 1 ) {
     // read one more word
-    if (NextData() != fkWordOK)
+    if (NextData() != kWordOK)
       {
        AliWarning("Next HC word missing");
         fRawReader->AddMajorErrorLog(kHCWordMissing,"Next HC word missing"); 
-       fNextStatus = fkNextHC;
+       fNextStatus = kNextHC;
        return;
       }
     if ( (*fDataWord & 0x3) == 1 ) {
@@ -998,11 +1005,11 @@ void AliTRDRawStream::DecodeHCheader(Int_t timeBins)
   // 3nd word (h[2])
   if ( fHCHWords >= 2 ) {
     // read one more word
-    if (NextData() != fkWordOK)
+    if (NextData() != kWordOK)
       {
        AliWarning("Next HC word missing");
         fRawReader->AddMajorErrorLog(kHCWordMissing,"Next HC word missing"); 
-       fNextStatus = fkNextHC;
+       fNextStatus = kNextHC;
        return;
       }
     if ( (*fDataWord & 0x3) == 1 ) {
@@ -1073,11 +1080,11 @@ void AliTRDRawStream::DecodeMCMheader()
   // AdcMask for Zero supressed data
   if ( fRawVersion == 3 ) {
     // read one more word
-    if (NextData() != fkWordOK)
+    if (NextData() != kWordOK)
       {
        AliWarning("MCM ADC mask missing");
         fRawReader->AddMajorErrorLog(kMCMADCMaskMissing,"Missing"); 
-       fNextStatus = fkNextHC;
+       fNextStatus = kNextHC;
        return;
       }
     if ( (*fDataWord & 0x000007ff) == 0xC ) {     // at the moment bits 4-10 are empty
index ed254f4238225cd86368307843f8a21ff0abd2fe..83e9356d3216ccd505f42b8592f193d5cdcccf7a 100644 (file)
@@ -5,22 +5,23 @@
 
 /* $Id$ */
 
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-// This class provides access to TRD digits in raw data.                     //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+// This class provides access to TRD digits in raw data.                  //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include <TObject.h>
 
-class AliTRDgeometry;
 class AliRawReader;
+
+class AliTRDgeometry;
 class AliTRDdigitsManager;
 
 // Some constants:
 const UInt_t kEndoftrackletmarker = 0xAAAAAAAA; /*This marks the end of tracklet data words*/
 const UInt_t kEndofrawdatamarker  = 0x00000000; /*This marks the end of half-chamber-data*/
-const UInt_t kSizeWord = sizeof(UInt_t);
+const UInt_t kSizeWord            = sizeof(UInt_t);
 
 class AliTRDRawStream: public TObject {
 
@@ -30,11 +31,11 @@ class AliTRDRawStream: public TObject {
     AliTRDRawStream(AliRawReader *rawReader);
     virtual ~AliTRDRawStream();
 
-    virtual Bool_t       Next();              // Read the next data
-    virtual Int_t NextChamber(AliTRDdigitsManager *man); // read next chamber data
-    virtual Int_t        Init();              // Init for the fRawVersion > 1
+    virtual Bool_t       Next();                                // Read the next data
+    virtual Int_t        NextChamber(AliTRDdigitsManager *man); // Read next chamber data
+    virtual Int_t        Init();                                // Init for the fRawVersion > 1
 
-    enum { kDDLOffset = 0x400 };              // Offset for DDL numbers
+    enum { kDDLOffset = 0x400 };                                // Offset for DDL numbers
 
     Bool_t               SetRawVersion(Int_t rv);
     Int_t                GetRawVersion() const                      { return fRawVersion;     };
@@ -56,25 +57,51 @@ class AliTRDRawStream: public TObject {
     Bool_t               IsGTULinkActive(Int_t sm, Int_t la, Int_t sta, Int_t side)
       { return ( ((fGTUlinkMask[sm][sta]) >> (2*la+side)) & 0x1 ); };
 
-    Int_t *GetSignals() { return fSig;}                         //  Signals in the three time bins from Data Word
-    Int_t GetADC() const { return fADC;}                            //  MCM ADC channel and Time Bin of word 1
-    Int_t GetTimeBin() const { return fTB - 3;}                             //  MCM ADC channel and Time Bin of word 1
-    Int_t GetEventNumber() const { return fEv;}                             //  MCM Event number and position of current MCM on TRD chamber
-    Int_t GetROB() const { return fROB;}                            //  MCM Event number and position of current MCM on TRD chamber
-    Int_t GetMCM() const { return fMCM;}                           //  MCM Event number and position of current MCM on TRD chamber
-    Int_t GetSM() const { return fSM;}                             //  Position of CURRENT half chamber in full TRD
-    Int_t GetLayer() const { return fLAYER;}                          //  PLANE = Position of CURRENT half chamber in full TRD
-    Int_t GetStack() const { return fSTACK;}                          //  CHAMBER = Position of CURRENT half chamber in full TRD
-    Int_t GetROC() const { return fROC;}                            //  Position of CURRENT half chamber in full TRD
-    Int_t GetSide() const { return fSIDE;}                           //  Position of CURRENT half chamber in full TRD
-    Int_t GetDCS() const { return fDCS;}                            //  DCS board number read from data (HC header)
-    Int_t GetRow() const { return fROW;}
-    Int_t GetCol() const { return fCOL;}                            //  Detector Pad coordinates
-    Int_t GetDet() const { return fDET;} // helper
-    Int_t GetLastDet() const { return fLastDET;} // helper
-    Int_t GetMaxRow() const { return fRowMax;}
-    Int_t GetMaxCol() const { return fColMax;}
-    Int_t GetNumberOfTimeBins() const {return fTBins;}
+    Int_t *GetSignals()                { return fSig;     } // Signals in the three time bins from Data Word
+    Int_t  GetADC() const              { return fADC;     } // MCM ADC channel and Time Bin of word 1
+    Int_t  GetTimeBin() const          { return fTB - 3;  } // MCM ADC channel and Time Bin of word 1
+    Int_t  GetEventNumber() const      { return fEv;      } // MCM Event number and position of current MCM
+    Int_t  GetROB() const              { return fROB;     } // MCM Event number and position of current MCM
+    Int_t  GetMCM() const              { return fMCM;     } // MCM Event number and position of current MCM
+    Int_t  GetSM() const               { return fSM;      } // Position of CURRENT half chamber in full TRD
+    Int_t  GetLayer() const            { return fLAYER;   } // PLANE = Position of CURRENT half chamber in full TRD
+    Int_t  GetStack() const            { return fSTACK;   } // CHAMBER = Position of CURRENT half chamber in full TRD
+    Int_t  GetROC() const              { return fROC;     } // Position of CURRENT half chamber in full TRD
+    Int_t  GetSide() const             { return fSIDE;    } // Position of CURRENT half chamber in full TRD
+    Int_t  GetDCS() const              { return fDCS;     } // DCS board number read from data (HC header)
+    Int_t  GetRow() const              { return fROW;     }
+    Int_t  GetCol() const              { return fCOL;     } // Detector Pad coordinates
+    Int_t  GetDet() const              { return fDET;     } // Helper
+    Int_t  GetLastDet() const          { return fLastDET; } // Helper
+    Int_t  GetMaxRow() const           { return fRowMax;  }
+    Int_t  GetMaxCol() const           { return fColMax;  }
+    Int_t  GetNumberOfTimeBins() const { return fTBins;   }
+
+ protected:
+
+    AliTRDgeometry *fGeo;                                   // TRD geometry
+
+    void   DecodeHCheader(Int_t timeBins);
+    void   DecodeMCMheader();
+    void   DecodeTracklet();
+    void   DecodeGTUlinkMask();
+    Int_t  DecodeDataWord();
+    Int_t  DecodeDataWordV1V2();                            // Valid for fRawversion = 1, 2, ... 
+    Int_t  DecodeDataWordV3();                              // Valid for fRawversion = 3, ... 
+
+    Int_t  NextData();                                      // Get the next piece of memory
+
+    enum { kStart
+         , kStop
+         , kWordOK
+         , kNoMoreData
+         , kNextSM
+         , kNextHC
+         , kSeekNonEoTracklet
+         , kDecodeHC
+         , kNextMCM
+         , kNextData
+         , kReading };
 
   private :
 
@@ -152,7 +179,7 @@ class AliTRDRawStream: public TObject {
     Bool_t   fSizeOK;                      //  Did we read anything
     UInt_t   fCountBytes;                  //  Bytes traversed in the buffer
     UInt_t   fBufSize;                     //  Size of the current RawReader buffer
-    Bool_t   fkBufferSet;                  //  Is the RawReader buffer available
+    Bool_t   fBufferSet;                   //  Is the RawReader buffer available
     UChar_t *fPos;                         //  Position in the buffer of the RawReader
     UInt_t  *fDataWord;                    //  The pointer to the current 32 bit data word
     UInt_t   fTimeBinsCalib;               //  N of time bins retrieved from calibration
@@ -172,24 +199,8 @@ class AliTRDRawStream: public TObject {
       ,kADCNumberOverflow = 12             //
       ,kADCChannelOverflow = 13            //
     };
-
- protected:
-
-    AliTRDgeometry *fGeo;                  //  TRD geometry
-
-    void  DecodeHCheader(Int_t timeBins);
-    void  DecodeMCMheader();
-    void  DecodeTracklet();
-    void  DecodeGTUlinkMask();
-    Int_t DecodeDataWord();
-    Int_t DecodeDataWordV1V2();                // Valid for fRawversion = 1, 2, ... 
-    Int_t DecodeDataWordV3();                  // Valid for fRawversion = 3, ... 
-
-    Int_t NextData(); // get the next piece of memory
-
-    enum { fkStart, fkStop, fkWordOK, fkNoMoreData, fkNextSM, fkNextHC, fkSeekNonEoTracklet, fkDecodeHC, fkNextMCM, fkNextData, fkReading};
     
-    ClassDef(AliTRDRawStream, 5)               // Class for reading TRD raw digits
+    ClassDef(AliTRDRawStream, 6)           // Class for reading TRD raw digits
 
 };
 #endif
index f9ac2724424d755375b96597462ba5d35eb75ead..1329f5617643d09d9ba47c9aec35ece04f975e0e 100644 (file)
@@ -68,7 +68,7 @@ class AliTRDRecParam : public TObject {
 
   // This is a singleton, constructor is private!  
   AliTRDRecParam();
-  ~AliTRDRecParam();
+  virtual ~AliTRDRecParam();
   
   ClassDef(AliTRDRecParam,1)          //  The reconstruction parameter
 
index d95628c1dd648815ad4e9f6eadc6459c96cde37e..0270fa42e979cc0f96ab8edb807bbb25d339f1f4 100644 (file)
 //  General container for data from TRD detector segments                    //
 //  Adapted from AliDigits, origin M.Ivanov                                  //
 //                                                                           //
-//  Author: M. Ploskon (ploskon@ikf.uni-frankfurt.de)                        //
+//  Author:                                                                  //
+//    Mateusz Ploskon (ploskon@ikf.uni-frankfurt.de)                         //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "AliTRDSignalIndex.h"
-
 #include "TArrayI.h"
+
 #include "AliLog.h"
 
+#include "AliTRDSignalIndex.h"
+
 ClassImp(AliTRDSignalIndex)
 
 //_____________________________________________________________________________
 AliTRDSignalIndex::AliTRDSignalIndex()
-  : TObject()
-  , fDet(-1)
-  , fLayer(-1)
-  , fStack(-1)
-  , fSM(-1)
-  , fIndex(NULL)
-  , fPositionRow(0)
-  , fPositionCol(0)
-  , fPositionTbin(0)
-  , fLastRow(0)
-  , fLastCol(0)
-  , fLastTbin(0)
-  , fNrows(0)
-  , fNcols(0)
-  , fNtbins(0)
-  , fMaxLimit(0)
-  , fResetCounters(kTRUE)
-  , fHasEntry(kFALSE)
+  :TObject()
+  ,fDet(-1)
+  ,fLayer(-1)
+  ,fStack(-1)
+  ,fSM(-1)
+  ,fIndex(NULL)
+  ,fPositionRow(0)
+  ,fPositionCol(0)
+  ,fPositionTbin(0)
+  ,fLastRow(0)
+  ,fLastCol(0)
+  ,fLastTbin(0)
+  ,fNrows(0)
+  ,fNcols(0)
+  ,fNtbins(0)
+  ,fMaxLimit(0)
+  ,fResetCounters(kTRUE)
+  ,fHasEntry(kFALSE)
 {
   //
-  // default contructor
+  // Default contructor
   //
+
   ResetCounters();
+
 }
 
 //_____________________________________________________________________________
 AliTRDSignalIndex::AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime)
-  : TObject()
-  , fDet(-1)
-  , fLayer(-1)
-  , fStack(-1)
-  , fSM(-1)
-  , fIndex(NULL)
-  , fPositionRow(0)
-  , fPositionCol(0)
-  , fPositionTbin(0)
-  , fLastRow(0)
-  , fLastCol(0)
-  , fLastTbin(0)
-  , fNrows(0)
-  , fNcols(0)
-  , fNtbins(0)
-  , fMaxLimit(0)
-  , fResetCounters(kTRUE)
-  , fHasEntry(kFALSE)
+  :TObject()
+  ,fDet(-1)
+  ,fLayer(-1)
+  ,fStack(-1)
+  ,fSM(-1)
+  ,fIndex(NULL)
+  ,fPositionRow(0)
+  ,fPositionCol(0)
+  ,fPositionTbin(0)
+  ,fLastRow(0)
+  ,fLastCol(0)
+  ,fLastTbin(0)
+  ,fNrows(0)
+  ,fNcols(0)
+  ,fNtbins(0)
+  ,fMaxLimit(0)
+  ,fResetCounters(kTRUE)
+  ,fHasEntry(kFALSE)
 {
-  // not the default contructor... hmmm...
+  //
+  // Not the default contructor... hmmm...
+  //
+
   Allocate(nrow, ncol, ntime);  
+
 }
 
 //_____________________________________________________________________________
-AliTRDSignalIndex::~AliTRDSignalIndex()
+AliTRDSignalIndex::AliTRDSignalIndex(const AliTRDSignalIndex &a)
+  :TObject(a)
+  ,fDet(a.fDet)
+  ,fLayer(a.fLayer)
+  ,fStack(a.fStack)
+  ,fSM(a.fSM)
+  ,fIndex(a.fIndex)
+  ,fPositionRow(a.fPositionRow)
+  ,fPositionCol(a.fPositionCol)
+  ,fPositionTbin(a.fPositionTbin)
+  ,fLastRow(a.fLastRow)
+  ,fLastCol(a.fLastCol)
+  ,fLastTbin(a.fLastTbin)
+  ,fNrows(a.fNrows)
+  ,fNcols(a.fNcols)
+  ,fNtbins(a.fNtbins)
+  ,fMaxLimit(a.fMaxLimit)
+  ,fResetCounters(a.fResetCounters)
+  ,fHasEntry(a.fHasEntry)
 {
   //
-  // Destructor
+  // Copy constructor
   //
 
-  delete fIndex;
-  fIndex = NULL;
 }
 
 //_____________________________________________________________________________
-AliTRDSignalIndex::AliTRDSignalIndex(const AliTRDSignalIndex &a)
-  : TObject(a)
-  , fDet(a.fDet)
-  , fLayer(a.fLayer)
-  , fStack(a.fStack)
-  , fSM(a.fSM)
-  , fIndex(a.fIndex)
-  , fPositionRow(a.fPositionRow)
-  , fPositionCol(a.fPositionCol)
-  , fPositionTbin(a.fPositionTbin)
-  , fLastRow(a.fLastRow)
-  , fLastCol(a.fLastCol)
-  , fLastTbin(a.fLastTbin)
-  , fNrows(a.fNrows)
-  , fNcols(a.fNcols)
-  , fNtbins(a.fNtbins)
-  , fMaxLimit(a.fMaxLimit)
-  , fResetCounters(a.fResetCounters)
-  , fHasEntry(a.fHasEntry)
+AliTRDSignalIndex::~AliTRDSignalIndex()
 {
   //
-  // Copy constructor
+  // Destructor
   //
+
+  delete fIndex;
+  fIndex = NULL;
+
 }
 
 //_____________________________________________________________________________
@@ -127,22 +137,23 @@ void AliTRDSignalIndex::Copy(TObject &a) const
   // Copy function
   //
 
-  ((AliTRDSignalIndex &)a).fDet = fDet;
-  ((AliTRDSignalIndex &)a).fLayer = fLayer;
-  ((AliTRDSignalIndex &)a).fStack = fStack;
-  ((AliTRDSignalIndex &)a).fSM = fSM;
-  ((AliTRDSignalIndex &)a).fIndex = fIndex;
-  ((AliTRDSignalIndex &)a).fPositionRow = fPositionRow;
-  ((AliTRDSignalIndex &)a).fPositionTbin = fPositionTbin;
-  ((AliTRDSignalIndex &)a).fLastRow = fLastRow;
-  ((AliTRDSignalIndex &)a).fLastCol = fLastCol;
-  ((AliTRDSignalIndex &)a).fLastTbin = fLastTbin;
-  ((AliTRDSignalIndex &)a).fNrows = fNrows;
-  ((AliTRDSignalIndex &)a).fNcols = fNcols;
-  ((AliTRDSignalIndex &)a).fNtbins = fNtbins;
-  ((AliTRDSignalIndex &)a).fMaxLimit = fMaxLimit;
+  ((AliTRDSignalIndex &)a).fDet           = fDet;
+  ((AliTRDSignalIndex &)a).fLayer         = fLayer;
+  ((AliTRDSignalIndex &)a).fStack         = fStack;
+  ((AliTRDSignalIndex &)a).fSM            = fSM;
+  ((AliTRDSignalIndex &)a).fIndex         = fIndex;
+  ((AliTRDSignalIndex &)a).fPositionRow   = fPositionRow;
+  ((AliTRDSignalIndex &)a).fPositionTbin  = fPositionTbin;
+  ((AliTRDSignalIndex &)a).fLastRow       = fLastRow;
+  ((AliTRDSignalIndex &)a).fLastCol       = fLastCol;
+  ((AliTRDSignalIndex &)a).fLastTbin      = fLastTbin;
+  ((AliTRDSignalIndex &)a).fNrows         = fNrows;
+  ((AliTRDSignalIndex &)a).fNcols         = fNcols;
+  ((AliTRDSignalIndex &)a).fNtbins        = fNtbins;
+  ((AliTRDSignalIndex &)a).fMaxLimit      = fMaxLimit;
   ((AliTRDSignalIndex &)a).fResetCounters = fResetCounters;
-  ((AliTRDSignalIndex &)a).fHasEntry = fHasEntry;
+  ((AliTRDSignalIndex &)a).fHasEntry      = fHasEntry;
+
 }
 
 //_____________________________________________________________________________
@@ -156,11 +167,12 @@ AliTRDSignalIndex& AliTRDSignalIndex::operator = (const AliTRDSignalIndex& a)
   return *this;
 
 }
+
 //_____________________________________________________________________________
 void AliTRDSignalIndex::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
 {
   //
-  // create the arrays
+  // Create the arrays
   //
 
   fNrows = nrow;
@@ -168,17 +180,18 @@ void AliTRDSignalIndex::Allocate(Int_t nrow, Int_t ncol,Int_t ntime)
   fNtbins = ntime;
 
   fMaxLimit = nrow * ncol * ntime + nrow * ncol * 2;
-  if (fIndex)
-    {
-      delete fIndex;
-      fIndex = NULL;
-    }
+  if (fIndex) {
+    delete fIndex;
+    fIndex = NULL;
+  }
 
   fIndex = new TArrayI(fMaxLimit);
-  //fIndex->Set(fMaxLimit);
   fIndex->Reset(-1);
+
   ResetCounters();
+
   fHasEntry = kFALSE;
+
 }
 
 //_____________________________________________________________________________
@@ -188,13 +201,14 @@ void AliTRDSignalIndex::Reset()
   // Reset the array but keep the size - realloc
   //
 
-  fDet = -1;
+  fDet   = -1;
   fLayer = -1;
   fStack = -1;
-  fSM = -1;
+  fSM    = -1;
 
-  // all will be lost 
+  // All will be lost 
   Allocate(fNrows, fNcols, fNtbins);
+
 }
 
 //_____________________________________________________________________________
@@ -206,7 +220,9 @@ void AliTRDSignalIndex::ResetContent()
 
   fIndex->Reset(-1);
   ResetCounters();
+
   fHasEntry = kFALSE;
+
 }
 
 //_____________________________________________________________________________
@@ -216,24 +232,24 @@ void AliTRDSignalIndex::ResetContentConditional(Int_t nrow, Int_t ncol,Int_t nti
   // Reset the array but keep the size if no need to enlarge - no realloc
   //
 
-  fDet = -1;
+  fDet   = -1;
   fLayer = -1;
   fStack = -1;
-  fSM = -1;
+  fSM    = -1;
+
+  if ((nrow  > fNrows) || 
+      (ncol  > fNcols) || 
+      (ntime > fNtbins)) {
+    Allocate(nrow, ncol, ntime);
+  }
+  else {
+    fIndex->Reset(-1);
+    ResetCounters();
+    fHasEntry = kFALSE;
+  }
 
-  if (nrow > fNrows || ncol > fNcols || ntime > fNtbins)
-    {
-      Allocate(nrow, ncol, ntime);
-    }
-  else
-    {
-      fIndex->Reset(-1);
-      ResetCounters();
-      fHasEntry = kFALSE;
-    }
 }
 
-
 //_____________________________________________________________________________
 void AliTRDSignalIndex::ClearAll()
 {
@@ -241,242 +257,181 @@ void AliTRDSignalIndex::ClearAll()
   // Reset the values - clear all!
   //
 
-  fDet = -1;
-  fLayer = -1;
-  fStack = -1;
-  fSM = -1;
+  fDet    = -1;
+  fLayer  = -1;
+  fStack  = -1;
+  fSM     = -1;
 
-  fNrows = -1;
-  fNcols = -1;
+  fNrows  = -1;
+  fNcols  = -1;
   fNtbins = -1;
 
-  if (fIndex)
-    {
-      delete fIndex;
-      fIndex = NULL;
-    }
+  if (fIndex) {
+    delete fIndex;
+    fIndex = NULL;
+  }
   fIndex = new TArrayI();
   ResetCounters();
+
   fHasEntry = kFALSE;
+
 }
 
 //_____________________________________________________________________________
 void AliTRDSignalIndex::AddIndexTBin(Int_t row, Int_t col, Int_t tbin)
 {
-  // store the index row-column-tbin as an interesting one
-  // the RC index is updated to!!!
-  // this is to be used in the TRD clusterizer!
-
-  //if (fPositionCol + fNtbins >= fMaxLimit)
-  if (row * col * tbin + row * col * 2 >= fMaxLimit)
-    {
-      AliError(Form("Out-of-limits fPositionCol + fNtbins %d. Limit is: %d", fPositionCol + fNtbins, fMaxLimit));
-      return;
-    }
+  //
+  // Store the index row-column-tbin as an interesting one
+  // The RC index is updated to!!!
+  // This is to be used in the TRD clusterizer!
+  //
+
+  if (row * col * tbin + row * col * 2 >= fMaxLimit) {
+    AliError(Form("Out-of-limits fPositionCol + fNtbins %d. Limit is: %d"
+                 ,fPositionCol + fNtbins
+                 ,fMaxLimit));
+    return;
+  }
+
+  if ((row != fLastRow) || 
+      (col != fLastCol)) {
 
-  if (row != fLastRow || col != fLastCol)
-    {
-      // new RC combination
-      if (fResetCounters == kTRUE)
-       {
-         fPositionRow = 0;
-         fPositionCol = 1;
-         
-         fResetCounters = kFALSE;
-       }
-      else
-       {
-         fPositionRow += fNtbins + 2;
-         fPositionCol += fNtbins + 2;
-       }
-
-      fPositionTbin = 1;
-
-      (*fIndex)[fPositionRow] = row;
-      (*fIndex)[fPositionCol] = col;
-      (*fIndex)[fPositionCol + fPositionTbin] = tbin;
-      //AliInfo(Form("x1: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
-      ++fPositionTbin;
+    // New RC combination
+    if (fResetCounters == kTRUE) {
+      fPositionRow    = 0;
+      fPositionCol   = 1;  
+      fResetCounters = kFALSE;
     }
-  else
-    {
-      // same RCT combination ?
-      //       if (fLastTbin == tbin)
-      //       {
-      //         AliWarning(Form("Same RCT? %d %d %d", row, col, tbin));
-      //       }
-      
-      (*fIndex)[fPositionCol + fPositionTbin] = tbin;
-      //AliInfo(Form("x2: fPositionCol + fPositionTbin = %d", fPositionCol + fPositionTbin));
-      ++fPositionTbin;      
+    else {
+      fPositionRow += fNtbins + 2;
+      fPositionCol += fNtbins + 2;
     }
+
+    fPositionTbin = 1;
+
+    (*fIndex)[fPositionRow] = row;
+    (*fIndex)[fPositionCol] = col;
+    (*fIndex)[fPositionCol + fPositionTbin] = tbin;
+    ++fPositionTbin;
+
+  }
+  else {
+
+    // Same RCT combination ?
+      
+    (*fIndex)[fPositionCol + fPositionTbin] = tbin;
+    ++fPositionTbin;      
+  
+  }
   
   fLastRow  = row;
   fLastCol  = col;
   fLastTbin = tbin;
 
   fHasEntry = kTRUE;
+
 }
 
 //_____________________________________________________________________________
 Bool_t  AliTRDSignalIndex::NextRCIndex(Int_t &row, Int_t &col)
 {
-  // return the position (index in the data array) of the next available pad
-
-  if (fResetCounters == kTRUE)
-    {
-      fPositionRow = 0;
-      fPositionCol = 1;
-      
-      fResetCounters = kFALSE;
-      //AliDebug(2, "Reset counters");
-    }
-  else
-    {
-      fPositionRow += fNtbins + 2;
-      fPositionCol += fNtbins + 2;
-    }
+  //
+  // Return the position (index in the data array) of the next available pad
+  //
 
-  if (fPositionRow >= fMaxLimit)
-    {
-      //AliDebug(8, "Out of index range");
-      return kFALSE;
-    }
+  if (fResetCounters == kTRUE) {
+    fPositionRow   = 0;
+    fPositionCol   = 1;
+    fResetCounters = kFALSE;
+  }
+  else {
+    fPositionRow  += fNtbins + 2;
+    fPositionCol  += fNtbins + 2;
+  }
 
-  //AliDebug(8, Form("Next RC %d", fPositionRow / (fNtbins + 2)));
+  if (fPositionRow >= fMaxLimit) {
+    return kFALSE;
+  }
 
   fPositionTbin = 1;
 
   row = (*fIndex)[fPositionRow];
   col = (*fIndex)[fPositionCol];
 
-  if (row > -1 && col > -1)
+  if ((row > -1) && 
+      (col > -1)) { 
     return kTRUE;
+  }
   
   return kFALSE;
+
 }
 
 //_____________________________________________________________________________
-Bool_t  AliTRDSignalIndex::NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin)
+Bool_t AliTRDSignalIndex::NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin)
 {
-  // return the position (index in the data array) of the next available tbin 
+  //
+  // Return the position (index in the data array) of the next available tbin 
   // within the current pad
+  //
 
-  if (fPositionRow >= fMaxLimit)
-    {
-      //AliDebug(8, "Out of index range");
-      return kFALSE;
-    }
+  if (fPositionRow >= fMaxLimit) {
+    return kFALSE;
+  }
 
-  if (NextTbinIndex(tbin))
-    {
-      row  = (*fIndex)[fPositionRow];
-      col  = (*fIndex)[fPositionCol];
-      fResetCounters = kFALSE;
-      return kTRUE;
-    }
-  else
-    {
-      if (NextRCIndex(row, col))
-       {
-         return NextRCTbinIndex(row, col, tbin);
-       }
+  if (NextTbinIndex(tbin)) {
+    row  = (*fIndex)[fPositionRow];
+    col  = (*fIndex)[fPositionCol];
+    fResetCounters = kFALSE;
+    return kTRUE;
+  }
+  else {
+    if (NextRCIndex(row, col)) {
+      return NextRCTbinIndex(row, col, tbin);
     }
+  }
 
   return kFALSE;
+
 }
 
 //_____________________________________________________________________________
-Bool_t  AliTRDSignalIndex::NextTbinIndex(Int_t &tbin)
+Bool_t AliTRDSignalIndex::NextTbinIndex(Int_t &tbin)
 {
-  // return the position (index in the data array) of the next available tbin 
+  //
+  // Return the position (index in the data array) of the next available tbin 
   // within the current pad
+  //
 
-  if (fPositionCol + fPositionTbin >= fMaxLimit || fPositionTbin > fNtbins)
-    {
-      //AliDebug(8, "Out of index range");
-      return kFALSE;
-    }
+  if ((fPositionCol + fPositionTbin >= fMaxLimit) || 
+      (fPositionTbin                >  fNtbins  )) {
+    return kFALSE;
+  }
 
   tbin = (*fIndex)[fPositionCol + fPositionTbin];
 
-  if (tbin > -1)
-    {
-      ++fPositionTbin;
-      return kTRUE;
-    }
+  if (tbin > -1) {
+    ++fPositionTbin;
+    return kTRUE;
+  }
 
   return kFALSE;
+
 }
 
-// void AliTRDSignalIndex::Dump()
-// {
-//   AliInfo("R C T...");
-//   Int_t i = 0;
-//   Int_t rcok = 0;
-//   while ( i < fMaxLimit )
-//     {
-//       if (i % (fNtbins + 2) == 0)
-//     {
-//       if ((*(*fIndex))[i] > -1)
-//         {
-//           rcok = 1;
-//           printf("\n RC : ");
-//         }
-//       else
-//         rcok = 0;
-//     }
-//       if (rcok)
-//     if ((*(*fIndex))[i] > -1)
-//       printf("[%d] = %d \t", i, (*(*fIndex))[i]); 
-//       i++;
-//     }
-// }
-
-// //_____________________________________________________________________________
-// void AliTRDSignalIndex::Dump()
-// {
-//   //
-//   // Dump the data
-//   //
-
-//   AliInfo("R C T...");
-//   Int_t i = 0;
-//   Int_t rcok = 0;
-//   while ( i < fMaxLimit )
-//     {
-//       if (i % (fNtbins + 2) == 0)
-//     {
-//       if ((*fIndex)[i] > -1)
-//         {
-//           rcok = 1;
-//           printf("\n RC : ");
-//         }
-//       else
-//         rcok = 0;
-//     }
-//       if (rcok)
-//     if ((*fIndex)[i] > -1)
-//       printf("[%d] = %d \t", i, (*fIndex)[i]); 
-//       i++;
-//     }
-// }
-
-// //_____________________________________________________________________________
-// void AliTRDSignalIndex::Dump2()
-// {
-//   //
-//   // Dump the data
-//   //
-
-//   AliInfo("R C T...");
-//   Int_t ir, ic, it;
-//   ResetCounters();
-//   while (NextRCIndex(ir, ic))
-//     {
-//       printf("\nR %d C %d t : ", ir, ic); 
-//       while (NextTbinIndex(it))
-//     printf("%d ", it); 
-//     }
-//   printf("\n");
-// }
+//_____________________________________________________________________________
+void AliTRDSignalIndex::ResetCounters()    
+{ 
+  //
+  // Reset the counters/iterators
+  //
+
+  fPositionRow   =  0;
+  fPositionCol   =  fPositionRow + 1;
+  fPositionTbin  =  1;
+  fLastRow       = -1;
+  fLastCol       = -1;
+  fLastTbin      = -1;
+  fResetCounters = kTRUE; 
+
+}
index 6b5b85f25e046e1adafc09e221e0e4f6651a2916..a9baf6b76bbc35763f0c52a003c72f19b68488b1 100644 (file)
  
 #include "TObject.h"
 
-/////////////////////////////////////////////////////////////
-//  General container for data from TRD detector segments  //
-//  Adapted from AliDigits, origin M.Ivanov                //
-/////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  General container for data from TRD detector segments                 //
+//  Adapted from AliDigits, origin M.Ivanov                               //
+//                                                                        //
+//  Author:                                                               //
+//    Mateusz Ploskon (ploskon@ikf.uni-frankfurt.de)                      //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
-//class TArrayI;
 #include "TArrayI.h"
 
 class AliTRDSignalIndex : public TObject
 {
+
  public:
 
   AliTRDSignalIndex(); 
   AliTRDSignalIndex(Int_t nrow, Int_t ncol,Int_t ntime);
   AliTRDSignalIndex(const AliTRDSignalIndex &d);
-  virtual ~AliTRDSignalIndex(); // destructor
+  virtual ~AliTRDSignalIndex();
   AliTRDSignalIndex &operator=(const AliTRDSignalIndex &d); 
-  virtual void   Copy(TObject &d) const; 
-  virtual void   Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
-  virtual void   Reset();
-
-  virtual void   ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime);
-  virtual void   ResetContent();
-
-  virtual void   ResetCounters()
-  {
-    // reset the counters/iterators
-    fPositionRow = 0;
-    fPositionCol = fPositionRow + 1;
-    fPositionTbin = 1;
-    
-    fLastRow = -1;
-    fLastCol = -1;
-    fLastTbin = -1;
-
-    fResetCounters = kTRUE;
-  }
-
-  virtual void   ResetTbinCounter()
-  {
-    // reset the time bin counter
-    
-    fPositionTbin = 1;
-  }
-
-  virtual void   AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
-
-  Bool_t  NextRCIndex(Int_t &row, Int_t &col); // get the next pad (row and column) and return kTRUE on success
-  Bool_t  NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin); // get the next timebin of a pad (row and column) and return kTRUE on success
-  Bool_t  NextTbinIndex(Int_t &tbin); // get the next active timebin and return kTRUE on success
-
-  Int_t   GetCurrentRow() {return (*fIndex)[fPositionRow];} // current row
-  Int_t   GetCurrentCol() {return (*fIndex)[fPositionCol];} // current col
-  Int_t   GetCurtentTbin() {return (*fIndex)[fPositionCol + fPositionTbin];} //current tbin
-  
-  void    ClearAll(); // clear the array, actually destroy and recreate w/o allocating
-  
-  //void    Dump(); // printf content - one way of iterating demo
-  //void    Dump2(); // printf content - another way of iterating demo
-
-  //Bool_t  IsAllocated() const {if (fIndex) return kTRUE; else return kFALSE;}
-  Bool_t  IsAllocated() const 
-  {
-    // return kTRUE if array allocated and there is no need to call allocate
-    if (!fIndex) 
-      return kFALSE; 
-    if (fIndex->GetSize() <= 0) 
-      return kFALSE; 
-    else return kTRUE;
-  }
-
-  void SetSM(Int_t ix) 
-  { 
-    // Set which SM
-    fSM = ix;
-  };
-
-  void SetStack(Int_t ix) 
-  { 
-    // Set which stack
-    fStack = ix;
-  };
-
-  void SetChamber(Int_t ix) 
-  {
-    // aka set stack
-    SetStack(ix);
-  }
-
-  void SetLayer(Int_t ix) 
-  { 
-    // Set which layer
-    fLayer = ix;
-  };
-
-  void SetPlane(Int_t ix) 
-  {
-    // aka set plane
-    SetLayer(ix);
-  }
-
-  void SetDetNumber(Int_t ix)
-  {
-    // Set Det Number
-    fDet = ix;
-  }
-  
-  virtual Int_t GetDetNumber() const {return fDet;} // Get Det number
-  virtual Int_t GetLayer() const     {return fLayer;} // Layer = Plane = position of the chamber in TRD
-  virtual Int_t GetPlane() const     {return fLayer;} // Layer = Plane = position of the chamber in TRD
-  virtual Int_t GetStack() const     {return fStack;} // Stack = Chameber = position of the chamber in TRD
-  virtual Int_t GetChamber() const   {return fStack;} // Stack = Chameber = position of the chamber in TRD
-  virtual Int_t GetSM() const        {return fSM;} // Super module of the TRD
 
-  virtual Bool_t HasEntry() const    {return fHasEntry;} // Return status if has an entry
+  virtual void     Copy(TObject &d) const; 
+  virtual void     Allocate(Int_t nrow, Int_t ncol,Int_t ntime);
 
-          TArrayI *GetArray() const  {return fIndex;} // Get the tarrayi pointer for god knows what reason
+  virtual void     Reset();
+  virtual void     ResetContentConditional(Int_t nrow, Int_t ncol,Int_t ntime);
+  virtual void     ResetContent();
+  virtual void     ResetCounters();
+  virtual void     ResetTbinCounter() { fPositionTbin  = 1; }
 
-  virtual Int_t GetNrow() const      {return fNrows;} // Get Nrows
-  virtual Int_t GetNcol() const      {return fNcols;} // Get Ncols
-  virtual Int_t GetNtime() const     {return fNtbins;} // Get Ntbins
+  virtual void     AddIndexTBin(Int_t row, Int_t col, Int_t tbin);
 
-  //enum { kMaxRows = 16, kMaxTbins = 24, kMaxCols = 144};
+          // Get the next pad (row and column) and return kTRUE on success
+          Bool_t   NextRCIndex(Int_t &row, Int_t &col); 
+          // Get the next timebin of a pad (row and column) and return kTRUE on success
+          Bool_t   NextRCTbinIndex(Int_t &row, Int_t &col, Int_t &tbin); 
+          // Get the next active timebin and return kTRUE on success
+          Bool_t   NextTbinIndex(Int_t &tbin); 
 
- private:
+          Int_t    GetCurrentRow() const  { return (*fIndex)[fPositionRow];                 }
+          Int_t    GetCurrentCol() const  { return (*fIndex)[fPositionCol];                 }
+          Int_t    GetCurrentTbin() const { return (*fIndex)[fPositionCol + fPositionTbin]; }
+  
+          // Clear the array, actually destroy and recreate w/o allocating
+          void     ClearAll(); 
+          // Return kTRUE if array allocated and there is no need to call allocate
+          Bool_t   IsAllocated() const    { if (!fIndex)                return kFALSE; 
+                                            if (fIndex->GetSize() <= 0) return kFALSE; 
+                                            else                        return kTRUE;       }
+
+          void     SetSM(Int_t ix)        { fSM      =    ix; }
+          void     SetStack(Int_t ix)     { fStack   =    ix; }
+          void     SetChamber(Int_t ix)   { SetStack(ix);     }
+          void     SetLayer(Int_t ix)     { fLayer   =    ix; }
+          void     SetPlane(Int_t ix)     { SetLayer(ix);     }
+          void     SetDetNumber(Int_t ix) { fDet     =    ix; }
+  
+  virtual Int_t    GetDetNumber() const   { return fDet;      } // Get Det number
+  virtual Int_t    GetLayer() const       { return fLayer;    } // Layer = Plane = position of the chamber in TRD
+  virtual Int_t    GetPlane() const       { return fLayer;    } // Layer = Plane = position of the chamber in TRD
+  virtual Int_t    GetStack() const       { return fStack;    } // Stack = Chameber = position of the chamber in TRD
+  virtual Int_t    GetChamber() const     { return fStack;    } // Stack = Chameber = position of the chamber in TRD
+  virtual Int_t    GetSM() const          { return fSM;       } // Super module of the TRD
+          TArrayI *GetArray() const       { return fIndex;    } // Get the tarrayi pointer for god knows what reason
 
-  Int_t   fDet;  // det number
-  Int_t   fLayer; // aka plane - position in the full TRD
-  Int_t   fStack; // aka chamber - position in the full TRD
-  Int_t   fSM; // super module - position in the full TRD
+  virtual Bool_t   HasEntry() const       { return fHasEntry; } // Return status if has an entry
 
- protected:
+  virtual Int_t    GetNrow() const        { return fNrows;    } // Get Nrows
+  virtual Int_t    GetNcol() const        { return fNcols;    } // Get Ncols
+  virtual Int_t    GetNtime() const       { return fNtbins;   } // Get Ntbins
 
-  TArrayI  *fIndex; //! monitor active pads and tbins
+ private:
 
-  Int_t    fPositionRow; // position in the index - jumps by 1 + 1 + fNtbins
-  Int_t    fPositionCol; // position in the index - jumps by 1 + 1 + fNtbins
-  Int_t    fPositionTbin; // position in the tbin - goes from 0 to fNtbins
+  Int_t     fDet;                //  Detector number
+  Int_t     fLayer;              //  Aka plane - position in the full TRD
+  Int_t     fStack;              //  Aka chamber - position in the full TRD
+  Int_t     fSM;                 //  Super module - position in the full TRD
 
-  Int_t    fLastRow; // to keep track what is the RC combination
-  Int_t    fLastCol; // to keep track what is the RC combination
-  Int_t    fLastTbin; // to keep track what is the Tbin - will catch if raw data bogus
+  TArrayI  *fIndex;              //! Monitor active pads and tbins
 
-  Int_t    fNrows; // number of rows in the chamber
-  Int_t    fNcols; // number of cols in the chamber
-  Int_t    fNtbins; // number of tbins in the chamber
+  Int_t     fPositionRow;        //  Position in the index - jumps by 1 + 1 + fNtbins
+  Int_t     fPositionCol;        //  Position in the index - jumps by 1 + 1 + fNtbins
+  Int_t     fPositionTbin;       //  Position in the tbin - goes from 0 to fNtbins
 
-  Int_t    fMaxLimit; // max number of things in the array  = nrow * ncol * ntime + nrow * ncol * 2
+  Int_t     fLastRow;            //  To keep track what is the RC combination
+  Int_t     fLastCol;            //  To keep track what is the RC combination
+  Int_t     fLastTbin;           //  To keep track what is the Tbin - will catch if raw data bogus
 
-  Bool_t   fResetCounters; // reset counter status
+  Int_t     fNrows;              //  Number of rows in the chamber
+  Int_t     fNcols;              //  Number of cols in the chamber
+  Int_t     fNtbins;             //  Number of tbins in the chamber
 
-  Bool_t   fHasEntry; // kTRUE flag if we have an entry 
+  Int_t     fMaxLimit;           //  Max number of things in the array  = nrow*ncol*ntime + nrow*ncol*2
+  Bool_t    fResetCounters;      //  Reset counter status
+  Bool_t    fHasEntry;           //  kTRUE flag if we have an entry 
 
-  ClassDef(AliTRDSignalIndex,1)      // Data container for one TRD detector segment
+  ClassDef(AliTRDSignalIndex,2)  //  Data container for one TRD detector segment
 
 };
 #endif
index b25a0f78e80a5a93da0201cbf479c288c7bf7a86..5a67fccdf5c5ff92c644180ee5fef1ce237493ae 100644 (file)
@@ -117,14 +117,14 @@ void AliTRDTriggerL1::Trigger()
   Int_t   sec;
   Bool_t  isElectron;
 
-  const Int_t maxEle = 1000;
+  const Int_t kMaxEle = 1000;
 
   Int_t   electronPlus;
   Int_t   electronMinus;
-  Int_t   sectorElePlus[maxEle];
-  Int_t   sectorEleMinus[maxEle];
-  Float_t ptElePlus[maxEle];   
-  Float_t ptEleMinus[maxEle];
+  Int_t   sectorElePlus[kMaxEle];
+  Int_t   sectorEleMinus[kMaxEle];
+  Float_t ptElePlus[kMaxEle];   
+  Float_t ptEleMinus[kMaxEle];
   Int_t   hadronLowPt;
   Int_t   hadronHighPt;
   Int_t   hadronJetLowPt;
index 2ffc94af2091af9ba2f5940d1a691b6246c2ef5e..a7935c3ddb5e3fc415816ac47d94c0e1d4b3b884 100644 (file)
 // Implementation of the TRD PID class                                    //
 //                                                                        //
 // Assigns the electron and pion likelihoods to each ESD track.           //
-// The function MakePID(AliESDEvent *event) calculates the probability         //
+// The function MakePID(AliESDEvent *event) calculates the probability    //
 // of having dedx and a maximum timbin at a given                         //
 // momentum (mom) and particle type k                                     //
 // from the precalculated distributions.                                  //
 //                                                                        //
 // Authors :                                                              //
-// Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> (Original version)//
-// Alex Bercuci (a.bercuci@gsi.de)                                        //
+//   Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> (orig. version) //
+//   Alex Bercuci (a.bercuci@gsi.de)                                      //
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
 #include "AliESDEvent.h"
 #include "AliESDtrack.h"
 #include "AliTracker.h"
+#include "AliRun.h"
 
 #include "AliTRDpidESD.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDcalibDB.h"
-#include "AliRun.h"
 #include "AliTRDtrack.h"
 #include "Cal/AliTRDCalPID.h"
 
-
 ClassImp(AliTRDpidESD)
 
-  Bool_t AliTRDpidESD::fCheckTrackStatus = kTRUE;
-  Bool_t AliTRDpidESD::fCheckKinkStatus  = kFALSE;
-  Int_t AliTRDpidESD::fMinPlane          = 0;
+Bool_t  AliTRDpidESD::fgCheckTrackStatus = kTRUE;
+Bool_t  AliTRDpidESD::fgCheckKinkStatus  = kFALSE;
+Int_t   AliTRDpidESD::fgMinPlane         = 0;
 
 //_____________________________________________________________________________
 AliTRDpidESD::AliTRDpidESD()
-  :TObject(), fTrack(0x0)
+  :TObject()
+  ,fTrack(0x0)
 {
   //
   // Default constructor
@@ -62,7 +62,8 @@ AliTRDpidESD::AliTRDpidESD()
 
 //_____________________________________________________________________________
 AliTRDpidESD::AliTRDpidESD(const AliTRDpidESD &p)
-  :TObject(p), fTrack(0x0)
+  :TObject(p)
+  ,fTrack(0x0)
 {
   //
   // AliTRDpidESD copy constructor
@@ -78,7 +79,9 @@ AliTRDpidESD::~AliTRDpidESD()
   //
   // Destructor
   //
-       if(fTrack) delete fTrack;
+
+  if(fTrack) delete fTrack;
+
 }
 
 //_____________________________________________________________________________
@@ -100,9 +103,9 @@ void AliTRDpidESD::Copy(TObject &p) const
   // Copy function
   //
 
-  ((AliTRDpidESD &) p).fCheckTrackStatus          = fCheckTrackStatus;
-  ((AliTRDpidESD &) p).fCheckKinkStatus           = fCheckKinkStatus;
-  ((AliTRDpidESD &) p).fMinPlane                  = fMinPlane;
+  ((AliTRDpidESD &) p).fgCheckTrackStatus         = fgCheckTrackStatus;
+  ((AliTRDpidESD &) p).fgCheckKinkStatus          = fgCheckKinkStatus;
+  ((AliTRDpidESD &) p).fgMinPlane                 = fgMinPlane;
   ((AliTRDpidESD &) p).fTrack                     = 0x0;
        
 }
@@ -121,6 +124,7 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event)
   //
   // Author
   // Alex Bercuci (A.Bercuci@gsi.de) 2nd May 2007
+  //
 
        AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
        if (!calibration) {
@@ -158,7 +162,9 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event)
                mom          = 0.;
                length       = 0.;
                nPlanePID    = 0;
-               for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] = 1./AliPID::kSPECIES;
+               for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) 
+                  p[iSpecies] = 1./AliPID::kSPECIES;
+
                for (Int_t iPlan = 0; iPlan < AliTRDgeometry::kNplan; iPlan++) {
                        // read data for track segment
                        for(int iSlice=0; iSlice<AliTRDtrack::kNslice; iSlice++)
@@ -190,7 +196,10 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event)
                Double_t probTotal = 0.;
                for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) probTotal   += p[iSpecies];
                if(probTotal <= 0.){
-                       AliWarningGeneral("AliTRDpidESD::MakePID()", Form("The total probability (%e) over all species <= 0 in ESD track %d. This may be caused by some error in reference data. Calculation continue but results might be corrupted.", probTotal, i));
+                       AliWarning(Form("The total probability (%e) over all species <= 0 in ESD track %d."
+                                       , probTotal, i));
+                       AliWarning("This may be caused by some error in reference data.");
+                       AliWarning("Calculation continues but results might be corrupted.");
                        continue;
                }
                for(Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] /= probTotal;
@@ -201,6 +210,7 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event)
        }
        
        return 0;
+
 }
 
 //_____________________________________________________________________________
@@ -211,19 +221,23 @@ Bool_t AliTRDpidESD::CheckTrack(AliESDtrack *t)
   //
        
        // Check the ESD track status
-       if (fCheckTrackStatus) {
+       if (fgCheckTrackStatus) {
                if (((t->GetStatus() & AliESDtrack::kTRDout  ) == 0) &&
                        ((t->GetStatus() & AliESDtrack::kTRDrefit) == 0)) return kFALSE;
        }
 
        // Check for ESD kink tracks
-       if (fCheckKinkStatus && (t->GetKinkIndex(0) != 0)) return kFALSE;
+       if (fgCheckKinkStatus && (t->GetKinkIndex(0) != 0)) return kFALSE;
 
        return kTRUE;
+
 }
 
 //_____________________________________________________________________________
-Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd, Int_t plan, Float_t &mom, Float_t &length)
+Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd
+                                               , Int_t plan
+                                               , Float_t &mom
+                                               , Float_t &length)
 {
   //
   // Retrive momentum "mom" and track "length" in TRD chamber from plane
@@ -231,6 +245,7 @@ Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd, Int_t plan, F
   //
   // Origin
   // Alex Bercuci (A.Bercuci@gsi.de)   
+  //
 
        const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.;
         const Float_t kDrWidth     = AliTRDgeometry::DrThick();
@@ -279,5 +294,5 @@ Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd, Int_t plan, F
        if(TMath::Abs(alpha-param->GetAlpha())>.01) return kFALSE;
        
        return kTRUE;
-}
 
+}
index 92fc99e23f3844d82d6331ae173f55855d14be4c..2cc59a8af4185b704bcd35054792f28fd0647278 100644 (file)
@@ -7,7 +7,11 @@
 
 ////////////////////////////////////////////////////////////////////////////
 //                                                                        //
-//  Assigns the PID probabilities based on TRD information to the ESDs    //
+// Assigns the PID probabilities based on TRD information to the ESDs     //
+//                                                                        //
+// Authors :                                                              //
+//   Prashant Shukla <shukla@pi0.physi.uni-heidelberg.de> (orig. version) //
+//   Alex Bercuci (a.bercuci@gsi.de)                                      //
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
@@ -18,6 +22,7 @@
 class AliESDEvent;
 class AliESDtrack;
 class AliExternalTrackParam;
+
 class AliTRDpidESD : public TObject {
 
  public:
@@ -31,26 +36,28 @@ class AliTRDpidESD : public TObject {
   static  Bool_t  CheckTrack(AliESDtrack *t);
           Int_t   MakePID(AliESDEvent *event);
 
-          void    SetCheckTrackStatus(Bool_t status = kTRUE) { fCheckTrackStatus = status; };
-          void    SetCheckKinkStatus(Bool_t status = kTRUE)  { fCheckKinkStatus  = status; };
-          void    SetMinPlane(Int_t plane)                   { fMinPlane         = plane;  };
+          void    SetCheckTrackStatus(Bool_t status = kTRUE) { fgCheckTrackStatus = status; };
+          void    SetCheckKinkStatus(Bool_t status = kTRUE)  { fgCheckKinkStatus  = status; };
+          void    SetMinPlane(Int_t plane)                   { fgMinPlane         = plane;  };
 
-         Bool_t  GetCheckTrackStatus()                      { return fCheckTrackStatus;   };      
-         Bool_t  GetCheckKinkStatus()                       { return fCheckKinkStatus;    };      
-          Int_t   GetMinPlane()                              { return fMinPlane;           };
+         Bool_t  GetCheckTrackStatus() const                { return fgCheckTrackStatus;   };      
+         Bool_t  GetCheckKinkStatus() const                 { return fgCheckKinkStatus;    };      
+          Int_t   GetMinPlane() const                        { return fgMinPlane;           };
 
 private:
-  Bool_t  RecalculateTrackSegmentKine(AliESDtrack *t, Int_t plan, Float_t &mom, Float_t &length);
 
-private:
+          Bool_t  RecalculateTrackSegmentKine(AliESDtrack *t
+                                            , Int_t plan
+                                            , Float_t &mom
+                                            , Float_t &length);
 
-  static  Bool_t  fCheckTrackStatus;    // Enable check on ESD track status
-  static  Bool_t  fCheckKinkStatus;     // Enable check on ESD kink track
-  static  Int_t   fMinPlane;            // Minimum number of planes
+  static  Bool_t  fgCheckTrackStatus;           //  Enable check on ESD track status
+  static  Bool_t  fgCheckKinkStatus;            //  Enable check on ESD kink track
+  static  Int_t   fgMinPlane;                   //  Minimum number of planes
 
-       AliExternalTrackParam *fTrack;                          //! Memory holder for Track segment calculations
+  AliExternalTrackParam *fTrack;                //! Memory holder for Track segment calculations
        
-  ClassDef(AliTRDpidESD,2)              // TRD PID class
+  ClassDef(AliTRDpidESD,2)                      //  TRD PID class
 
 };
 
index fd6f9fa7290aace29d3d89380bb35037b8fbebb3..9d828e5af3ad7ddeb42a5b26ead514ab7035818e 100644 (file)
 
 /* $Id$ */
 
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  TRD simulation - multimodule (regular rad.)                              //
-//  after: M. CASTELLANO et al., COMP. PHYS. COMM. 51 (1988) 431             //
-//                             + COMP. PHYS. COMM. 61 (1990) 395             //
-//                                                                           //
-//   17.07.1998 - A.Andronic                                                 //
-//   08.12.1998 - simplified version                                         //
-//   11.07.2000 - Adapted code to aliroot environment (C.Blume)              //
-//   04.06.2004 - Momentum dependent parameters implemented (CBL)            //
-//                                                                           //
-///////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//                                                                        //
+//  TRD simulation - multimodule (regular rad.)                           //
+//  after: M. CASTELLANO et al., COMP. PHYS. COMM. 51 (1988) 431          //
+//                             + COMP. PHYS. COMM. 61 (1990) 395          //
+//                                                                        //
+//   17.07.1998 - A.Andronic                                              //
+//   08.12.1998 - simplified version                                      //
+//   11.07.2000 - Adapted code to aliroot environment (C.Blume)           //
+//   04.06.2004 - Momentum dependent parameters implemented (CBL)         //
+//                                                                        //
+////////////////////////////////////////////////////////////////////////////
 
 #include <stdlib.h>
 
@@ -999,7 +999,7 @@ Int_t AliTRDsimTR::Locate(Double_t *xv, Int_t n, Double_t xval
 }
 
 //_____________________________________________________________________________
-Int_t AliTRDsimTR::SelectNFoils(Float_t p)
+Int_t AliTRDsimTR::SelectNFoils(Float_t p) const
 {
   //
   // Selects the number of foils corresponding to the momentum
index 2517ae634d86a124a43f28f45e2ff8a419efb12d..d3161e0e6277a7e706f789bbcf11511875109830 100644 (file)
@@ -40,7 +40,7 @@ class AliTRDsimTR : public TObject {
   virtual Int_t    Locate(Double_t *xv, Int_t n, Double_t xval
                         , Int_t &kl, Double_t &dx);
   virtual Double_t Omega(Float_t rho, Float_t z, Float_t a)  { return (28.8 * TMath::Sqrt(rho * z / a)); };
-  virtual Int_t    SelectNFoils(Float_t p);
+  virtual Int_t    SelectNFoils(Float_t p) const;
 
           void     SetFoilThick(Float_t t)                   { fFoilThick = t;
                                                                SetSigma();                                  };
index 76c50706b1487b02caea22da5f40a770e7e65832..462ec829e1e4eb32f7936e1e332a10cdd7a1d012 100644 (file)
@@ -33,7 +33,7 @@ class AliTRDtransform : public TObject {
   AliTRDtransform();
   AliTRDtransform(Int_t det);
   AliTRDtransform(const AliTRDtransform &t);
-  ~AliTRDtransform();
+  virtual ~AliTRDtransform();
   AliTRDtransform &operator=(const AliTRDtransform &t) { *(new(this) AliTRDtransform(t));
                                                           return *this; }
 
index 08c8f7b538d984ad1fc493504debddf4ec50defe..2435f75d362f408bd71430182aae05181d93c01d 100644 (file)
@@ -196,6 +196,9 @@ void AliTRDtrigger::Copy(TObject &) const
 //_____________________________________________________________________________
 void AliTRDtrigger::Init()
 {
+  //
+  // Initialization
+  //
 
   fModule = new AliTRDmodule(); 
   fTracks->Clear();