Coding violations fixed (first bunch!)
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Mar 2008 14:53:28 +0000 (14:53 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Mar 2008 14:53:28 +0000 (14:53 +0000)
HMPID/AliHMPIDCalib.h
HMPID/AliHMPIDCluster.cxx
HMPID/AliHMPIDCluster.h
HMPID/AliHMPIDDigit.h
HMPID/AliHMPIDParam.cxx
HMPID/AliHMPIDParam.h
HMPID/AliHMPIDPreprocessor.cxx
HMPID/AliHMPIDQADataMakerRec.cxx
HMPID/AliHMPIDQADataMakerSim.cxx
HMPID/AliHMPIDRawStream.cxx
HMPID/AliHMPIDRawStream.h

index 96d2fb2..d47b025 100644 (file)
@@ -37,13 +37,13 @@ public:
          void InitFile(Int_t inVal);                                        //Init the ADC histo output file (one per LDC or one per DDL)
          void CloseFile();                                                  //Close the file
          void SetRunParams(ULong_t runNum,Int_t timeStamp, Int_t ldcId);    //Set Run Parameters such as Run Number, TimeStamp, LDCid 
-  inline void SetSigCut(Int_t nSigCut) { fSigCut=nSigCut;}                  //Set Sigma Cuts from Setter
+         void SetSigCut(Int_t nSigCut) { fSigCut=nSigCut;}                  //Set Sigma Cuts from Setter
          void SetSigCutFromFile(Char_t* name);                              //Set Sigma Cuts from File
-  inline void SetWriteHistoPads(Bool_t isOn) {fWritePads=isOn;}             //Set wether ADC histos of pads are written or not
-  inline void SetWriteHistoPads(Bool_t isOn,Bool_t isLarge,Int_t nDDL) {fWritePads=isOn;fLargeHisto=isLarge;fSelectDDL=nDDL;}             //Set wether ADC histos of pads are written or not
-  inline Bool_t GetWritePads()            {return fWritePads;}              //Set wether ADC histos of pads are written or not
-  inline Bool_t GetLargePads()            {return fLargeHisto;}             //Set wether ADC histos of pads are written or not
-  inline Bool_t GetSelectedDDL()          {return fSelectDDL;}              //Set wether ADC histos of pads are written or not
+         void SetWriteHistoPads(Bool_t isOn) {fWritePads=isOn;}             //Set wether ADC histos of pads are written or not
+         void SetWriteHistoPads(Bool_t isOn,Bool_t isLarge,Int_t nDDL) {fWritePads=isOn;fLargeHisto=isLarge;fSelectDDL=nDDL;}             //Set wether ADC histos of pads are written or not
+         Bool_t GetWritePads()       const{return fWritePads;}              //Set wether ADC histos of pads are written or not
+         Bool_t GetLargePads()       const{return fLargeHisto;}             //Set wether ADC histos of pads are written or not
+         Bool_t GetSelectedDDL()     const{return fSelectDDL;}              //Set wether ADC histos of pads are written or not
 protected: 
 
     Bool_t     *faddl;                                                         //check is ddl is filled
@@ -64,6 +64,11 @@ protected:
     Int_t      *fnDDLOutStream;                                                // if the DDL is in the raw data
     Bool_t      fLargeHisto;                                                   //Default is kFALSE.if kTRUE then write large pad histograms with 4093 bins!!!! Only if you have 2GB of RAM!!!   
     Int_t       fSelectDDL;                                                    //Select the DDL to write for the in the large histograms. Only ONE at one time!
+    
+private:
+  AliHMPIDCalib(const AliHMPIDCalib& c);              //dummy copy constructor
+  AliHMPIDCalib &operator=(const AliHMPIDCalib& c);   //dummy assignment operator
+    
     ClassDef(AliHMPIDCalib,3)                                                  //HMPID calibration and pedestal class        
 };
 #endif
index 9d8b46c..ceb7c7b 100644 (file)
@@ -39,15 +39,15 @@ void AliHMPIDCluster::SetClusterParams(Double_t xL,Double_t yL,Int_t iCh  )
   //get L->T cs matrix for a given chamber
   const TGeoHMatrix *t2l= AliGeomManager::GetTracking2LocalMatrix(volId);
 
-  if(AliHMPIDParam::fgInstanceType)               //if there is no geometry we cannot retrieve the volId (only for monitoring)
+  if(fParam->GetInstType())               //if there is no geometry we cannot retrieve the volId (only for monitoring)
   {
     new(this) AliCluster3D(); return;
   }
   
 
   //transformation from the pad cs to local
-  xL -= 0.5*AliHMPIDParam::SizeAllX();      //size of all pads with dead zones included
-  yL -= 0.5*AliHMPIDParam::SizeAllY();
+  xL -= 0.5*fParam->SizeAllX();      //size of all pads with dead zones included
+  yL -= 0.5*fParam->SizeAllY();
 
   // Get the position in the tracking cs
   Double_t posL[3]={xL, yL, 0.};            //this is the LORS of HMPID
@@ -118,7 +118,7 @@ void AliHMPIDCluster::CoG()
   fNlocMax=0;                                               // proper status from this method
   fSt=kCoG;
   
-  if(AliHMPIDParam::fgInstanceType) SetClusterParams(fXX,fYY,fCh);                              //need to fill the AliCluster3D part
+  if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh);                              //need to fill the AliCluster3D part
  
 }//CoG()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -128,8 +128,8 @@ void AliHMPIDCluster::CorrSin()
 // Arguments: none
 //   Returns: none
   Int_t pc,px,py;
-  AliHMPIDParam::Lors2Pad(fXX,fYY,pc,px,py);             //tmp digit to get it center
-  Float_t x=fXX-AliHMPIDParam::LorsX(pc,px);                    //diff between cluster x and center of the pad contaning this cluster   
+  fParam->Lors2Pad(fXX,fYY,pc,px,py);             //tmp digit to get it center
+  Float_t x=fXX-fParam->LorsX(pc,px);                    //diff between cluster x and center of the pad contaning this cluster   
   fXX+=3.31267e-2*TMath::Sin(2*TMath::Pi()/0.8*x)-2.66575e-3*TMath::Sin(4*TMath::Pi()/0.8*x)+2.80553e-3*TMath::Sin(6*TMath::Pi()/0.8*x)+0.0070;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -256,7 +256,7 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold)
   Int_t iCluCnt=pCluLst->GetEntriesFast();                                               //get current number of clusters already stored in the list by previous operations
   if(isTryUnfold==kFALSE || Size()==1) {                                                 //if cluster contains single pad there is no way to improve the knowledge 
     fSt = (isTryUnfold)? kSi1: kNot;
-    if(AliHMPIDParam::fgInstanceType) SetClusterParams(fXX,fYY,fCh);  
+    if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh);  
     new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);  //add this raw cluster 
     return 1;
   } 
@@ -300,10 +300,10 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold)
     if(iCnt==0&&fNlocMax<kMaxLocMax){                                                    //this pad has Q more then any neighbour so it's local maximum
       
       Double_t xStart=pDig1->LorsX();Double_t yStart=pDig1->LorsY();
-      Double_t xMin=xStart-AliHMPIDParam::SizePadX();
-      Double_t xMax=xStart+AliHMPIDParam::SizePadX();
-      Double_t yMin=yStart-AliHMPIDParam::SizePadY();
-      Double_t yMax=yStart+AliHMPIDParam::SizePadY();
+      Double_t xMin=xStart-fParam->SizePadX();
+      Double_t xMax=xStart+fParam->SizePadX();
+      Double_t yMin=yStart-fParam->SizePadY();
+      Double_t yMax=yStart+fParam->SizePadY();
       
       ierflg = fitter->SetParameter(3*fNlocMax  ,Form("x%i",fNlocMax),xStart,0.1,xMin,xMax);    // X,Y,Q initial values of the loc max pad
       ierflg = fitter->SetParameter(3*fNlocMax+1,Form("y%i",fNlocMax),yStart,0.1,yMin,yMax);    // X, Y constrained to be near the loc max
@@ -328,7 +328,7 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold)
 
 // case 2 -> loc max found. Check # of loc maxima 
  if ( fNlocMax >= kMaxLocMax)  { 
- if(AliHMPIDParam::fgInstanceType) SetClusterParams(fXX,fYY,fCh);                                                           // if # of local maxima exceeds kMaxLocMax...
+ if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh);                                                           // if # of local maxima exceeds kMaxLocMax...
    fSt = kMax;   new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);                      //...add this raw cluster  
    } else {                                                                               //or resonable number of local maxima to fit and user requested it
   // Now ready for minimization step
@@ -363,7 +363,7 @@ Int_t AliHMPIDCluster::Solve(TClonesArray *pCluLst,Bool_t isTryUnfold)
         if ( !IsInPc()) fSt = kEdg;                                                      // if Out of Pc
         if(fSt==kNoLoc) fNlocMax=0;                                                      // if with no loc max (pads with same charge..)
       }
-      if(AliHMPIDParam::fgInstanceType) SetClusterParams(fXX,fYY,fCh);                                                      //need to fill the AliCluster3D part
+      if(fParam->GetInstType()) SetClusterParams(fXX,fYY,fCh);                                                      //need to fill the AliCluster3D part
       new ((*pCluLst)[iCluCnt++]) AliHMPIDCluster(*this);                               //add new unfolded cluster
       
    }
index a836eac..9d1f644 100644 (file)
@@ -21,7 +21,12 @@ class AliHMPIDCluster :public AliCluster3D
 public:
   enum EClusterStatus {kFrm,kCoG,kLo1,kUnf,kMax,kNot,kEdg,kSi1,kNoLoc,kAbn,kEmp=-1};      //status flags    
       AliHMPIDCluster():AliCluster3D(),
-                          fCh(-1),fSi(-1),fSt(kEmp),fBox(-1),fNlocMax(-1),fMaxQpad(-1),fMaxQ(-1),fQRaw(0),fQ(0),fErrQ(-1),fXX(0),fErrX(-1),fYY(0),fErrY(-1),fChi2(-1),fDigs(0) {} //empty ctor
+                          fCh(-1),fSi(-1),fSt(kEmp),fBox(-1),fNlocMax(-1),fMaxQpad(-1),fMaxQ(-1),fQRaw(0),
+                          fQ(0),fErrQ(-1),fXX(0),fErrX(-1),fYY(0),fErrY(-1),fChi2(-1),fDigs(0) 
+      {
+        AliHMPIDParam *pParam=AliHMPIDParam::Instance();
+        fParam = pParam;
+      }//ctor
   
 
       AliHMPIDCluster(const AliHMPIDCluster &c):AliCluster3D(c),
@@ -33,7 +38,7 @@ public:
 //framework part                   
          void           Draw   (Option_t *opt=""                                  );                       //overloaded TObject::Print() to draw cluster in current canvas
          void           Print  (Option_t *opt=""                                  )const;                  //overloaded TObject::Print() to print cluster info
-  static void           FitFunc(Int_t &iNpars, Double_t* /*deriv*/, Double_t &chi2, Double_t *par, Int_t iflag);//fit function to be used by MINUIT
+  static void           FitFunc(Int_t &iNpars, Double_t* deriv, Double_t &chi2, Double_t *par, Int_t iflag);//fit function to be used by MINUIT
 //private part  
          Int_t          Box      (                                         )const{return fBox;                                  }  //Dimension of the cluster
          void           CoG      (                                         );                                                      //calculates center of gravity
@@ -59,14 +64,6 @@ public:
          void           SetX     (Double_t x                               ){fXX=x;}                                                // Setter
          void           SetY     (Double_t y                               ){fYY=y;}                                                // Setter
          
-private:
-/*
-  AliHMPIDCluster &operator=(const AliHMPIDCluster &c) {if(this == &c)return *this;AliCluster3D::operator=(c);          
-                                                       fSi=c.fSi;  fSt=c.fSt; fCh=c.fCh; fBox=c.fBox;fNlocMax=c.fNlocMax;fMaxQpad=c.fMaxQpad; fMaxQ=c.fMaxQ;fQRaw=c.fQRaw;
-                                                        fQ=c.fQ; fErrQ=c.fErrQ; 
-                                                        fXX=c.fXX; fErrX=c.fErrX;
-                                                        fYY=c.fYY; fErrY=c.fErrY; fChi2=c.fChi2;fDigs=c.fDigs ? new TObjArray(*c.fDigs):0; return *this;}
-*/
 protected:
   Int_t         fCh;          //chamber number
   Int_t         fSi;          //size of the formed cluster from which this cluster deduced
@@ -85,6 +82,20 @@ protected:
   Double_t      fChi2;        //some estimator of the fit quality
   TObjArray    *fDigs;        //! list of digits forming this cluster
   static  Bool_t fgDoCorrSin; //flag to switch on/off correction for Sinusoidal to cluster reco
+  AliHMPIDParam *fParam;      // Pointer to AliHMPIDParam
+  
+private:
+/*
+  AliHMPIDCluster &operator=(const AliHMPIDCluster &c) {if(this == &c)return *this;AliCluster3D::operator=(c);          
+                                                       fSi=c.fSi;  fSt=c.fSt; fCh=c.fCh; fBox=c.fBox;fNlocMax=c.fNlocMax;fMaxQpad=c.fMaxQpad; fMaxQ=c.fMaxQ;fQRaw=c.fQRaw;
+                                                        fQ=c.fQ; fErrQ=c.fErrQ; 
+                                                        fXX=c.fXX; fErrX=c.fErrX;
+                                                        fYY=c.fYY; fErrY=c.fErrY; fChi2=c.fChi2;fDigs=c.fDigs ? new TObjArray(*c.fDigs):0; return *this;}
+*/
+//  AliHMPIDCluster(const AliHMPIDCluster& c);              //dummy copy constructor
+  AliHMPIDCluster &operator=(const AliHMPIDCluster& c);   //dummy assignment operator
+      
+  
   ClassDef(AliHMPIDCluster,8) //HMPID cluster class
 };
 
index a484e58..1666554 100644 (file)
@@ -54,7 +54,6 @@ public:
   inline void    Raw(UInt_t &w32,Int_t &ddl,Int_t &r,Int_t &d,Int_t &a)const;
   inline Bool_t  Set         (Int_t c,Int_t p,Int_t x,Int_t y,Int_t tid=0);                                                            //manual creation 
          void    SetQ        (Float_t q                      )     {fQ=q;}                                                             //manual creation 
-         void    SetNsig     (Int_t sigmas                   )     {AliHMPIDParam::fgSigmas=sigmas;}                                                  //set n sigmas 
 
  
 protected:                                                                   //AliDigit has fTracks[3]
index ac5475a..b027331 100644 (file)
@@ -41,7 +41,6 @@ Float_t AliHMPIDParam::fgPcY=0;
 Float_t AliHMPIDParam::fgAllX=0;
 Float_t AliHMPIDParam::fgAllY=0;
 
-Int_t AliHMPIDParam::fgSigmas=4;
 Bool_t AliHMPIDParam::fgInstanceType=kTRUE;  
 
 AliHMPIDParam* AliHMPIDParam::fgInstance=0x0;        //singleton pointer               
@@ -52,6 +51,8 @@ AliHMPIDParam::AliHMPIDParam(Bool_t noGeo=kFALSE):TNamed("HmpidParam","default v
 // In particular, matrices to be used for LORS<->MARS trasnformations are initialized from TGeo structure.    
 // Note that TGeoManager should be already initialized from geometry.root file  
 
+  fgSigmas=4;
+
   fRadNmean = MeanIdxRad(); //initialization of the running ref. index of freon
   
   Float_t dead=2.6;// cm of the dead zones between PCs-> See 2CRC2099P1
index 99613e0..f5fff4a 100644 (file)
@@ -56,8 +56,8 @@ public:
 
   static Bool_t  IsOverTh    (Float_t q                      )     {return q >= fgSigmas;                            }  //is digit over threshold?
   
-  Double_t GetRefIdx         (                               )     {return fRadNmean;                                }  //refractive index of freon
-  Bool_t  GetInstType (                               )     {return fgInstanceType;                            }  //return if the instance is from geom or ideal                        
+  Double_t GetRefIdx         (                               )const{return fRadNmean;                                }  //refractive index of freon
+  Bool_t  GetInstType        (                               )const{return fgInstanceType;                            }  //return if the instance is from geom or ideal                        
   
   inline static Bool_t IsInDead(Float_t x,Float_t y        );                                                           //is the point in dead area?
   static Bool_t  IsInside    (Float_t x,Float_t y,Float_t d=0)     {return  x>-d&&y>-d&&x<fgkMaxPcX[kMaxPc]+d&&y<fgkMaxPcY[kMaxPc]+d; } //is point inside chamber boundaries?
@@ -89,8 +89,9 @@ public:
   void     Norm        (Int_t c,Double_t *n                                 )const{Double_t l[3]={0,0,1};fM[c]->LocalToMasterVect(l,n);        }//norm
   void     Point       (Int_t c,Double_t *p,Int_t plane                     )const{Lors2Mars(c,0,0,p,plane);}      //point of given chamber plane
 
-  void     SetRefIdx   (Double_t refRadIdx                                  ) {fRadNmean = refRadIdx;}             //set refractive index of freon
-    
+  void     SetRefIdx      (Double_t refRadIdx                                  ) {fRadNmean = refRadIdx;}             //set refractive index of freon
+  void     SetSigmas      (Int_t sigmas                                        ) {fgSigmas = sigmas;}                 //set sigma cut    
+  void     SetInstanceType(Bool_t inst                                         ) {fgInstanceType = inst;}             //kTRUE if from geomatry kFALSE if from ideal geometry
   //For PID
   Double_t SigLoc      (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to cathode segmetation
   Double_t SigGeom     (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta);//error due to unknown photon origin
@@ -100,16 +101,16 @@ public:
   enum EPlaneId {kPc,kRad,kAnod};            //3 planes in chamber 
   enum ETrackingFlags {kMipDistCut=-9,kMipQdcCut=-5,kNoPhotAccept=-11};     //flags for Reconstruction
 
-  static Int_t    fgSigmas;   //sigma Cut
-  static Bool_t   fgInstanceType;             //kTRUE if from geomatry kFALSE if from ideal geometry
-  
 protected:
   static /*const*/ Float_t fgkMinPcX[6];                                                           //limits PC
   static /*const*/ Float_t fgkMinPcY[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcX[6];                                                           //limits PC
   static /*const*/ Float_t fgkMaxPcY[6]; 
 
-  static Float_t fgCellX, fgCellY, fgPcX, fgPcY, fgAllX, fgAllY;
+  static Int_t    fgSigmas;                                                                        //sigma Cut
+  static Bool_t   fgInstanceType;                                                                  //kTRUE if from geomatry kFALSE if from ideal geometry
+
+  static Float_t fgCellX, fgCellY, fgPcX, fgPcY, fgAllX, fgAllY;                                   //definition of HMPID geometric parameters 
          AliHMPIDParam(Bool_t noGeo);             //default ctor is protected to enforce it to be singleton
 
   static AliHMPIDParam *fgInstance;   //static pointer  to instance of AliHMPIDParam singleton
index e0e3f05..85ff3e8 100644 (file)
@@ -24,6 +24,10 @@ ClassImp(AliHMPIDPreprocessor)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDPreprocessor::Initialize(Int_t run, UInt_t startTime,UInt_t endTime)
 {
+// Initialize the parameter coming from AliPreprocessor
+//  run -> run number
+// startTime -> starting time 
+// endTime   -> ending time
   AliPreprocessor::Initialize(run, startTime, endTime);
   
   AliInfo(Form("HMPID started for Run %d \n\tStartTime %s \n\t  EndTime %s", run,TTimeStamp(startTime).AsString(),TTimeStamp(endTime).AsString()));
index 7c81e6e..f275e30 100644 (file)
 #include "AliHMPIDParam.h"
 #include "AliHMPIDRawStream.h"
 #include "AliLog.h"
+
+//
+// HMPID AliHMPIDQADataMakerRec base class
+// for QA of reconstruction
+// here also errors are calculated
+//.
+
 ClassImp(AliHMPIDQADataMakerRec)
            
 //____________________________________________________________________________ 
@@ -89,16 +96,16 @@ void AliHMPIDQADataMakerRec::InitRaws()
 //
 // Booking QA histo for Raw data
 //
-  const Int_t nerr = (Int_t)AliHMPIDRawStream::kSumErr+1;
+  const Int_t kNerr = (Int_t)AliHMPIDRawStream::kSumErr+1;
   TH1F *hqPad[14], *hSumErr[14];
 
   for(Int_t iddl =0; iddl<AliHMPIDRawStream::kNDDL; iddl++) {
     hqPad[iddl] = new TH1F(Form("hqPadDDL%i",iddl), Form("Pad Q Entries at DDL %i",iddl), 500,0,5000);
     Add2RawsList(hqPad[iddl],iddl);
-    hSumErr[iddl] = new TH1F(Form("SumErrDDL%i",iddl), Form("Error summary for ddl %i",iddl), 2*nerr,0,2*nerr);
+    hSumErr[iddl] = new TH1F(Form("SumErrDDL%i",iddl), Form("Error summary for ddl %i",iddl), 2*kNerr,0,2*kNerr);
     hSumErr[iddl]->SetYTitle("%");
     
-    for(Int_t ilabel=0; ilabel< nerr; ilabel++) {
+    for(Int_t ilabel=0; ilabel< kNerr; ilabel++) {
       hSumErr[iddl]->GetXaxis()->CenterLabels(kTRUE);
       //hSumErr[iddl]->GetXaxis()->SetBinLabel((2*ilabel+1),Form("%i  %s",ilabel+1,hnames[ilabel]));
       hSumErr[iddl]->GetXaxis()->SetBinLabel((2*ilabel+1),Form("%i  %s",ilabel+1,AliHMPIDRawStream::GetErrName(ilabel)));
@@ -150,9 +157,9 @@ void AliHMPIDQADataMakerRec::MakeRaws(AliRawReader *rawReader)
 
        for(Int_t iErr =1; iErr<(Int_t)AliHMPIDRawStream::kSumErr; iErr++){
  
-         Int_t NumOfErr = stream.GetErrors(ddl,iErr);
+         Int_t numOfErr = stream.GetErrors(ddl,iErr);
 
-         GetRawsData(ddl+14)->Fill(iErr,NumOfErr);
+         GetRawsData(ddl+14)->Fill(iErr,numOfErr);
        }
      }
    stream.Delete();
index 02a6be4..dc2fbf7 100644 (file)
 #include "AliHMPIDParam.h"
 #include "AliHMPIDRawStream.h"
 #include "AliLog.h"
+
+//
+// HMPID AliHMPIDQADataMakerSim base class
+// for QA of simulation
+// here also errors are calculated
+//.
+
 ClassImp(AliHMPIDQADataMakerSim)
            
 //____________________________________________________________________________ 
index 97a0918..a0c73f3 100644 (file)
@@ -25,9 +25,6 @@
 #include "AliRawReader.h"
 #include "AliLog.h"
 
-static Bool_t stDeb = kFALSE;      
-//static Bool_t stDeb = kTRUE;      
-
 ClassImp(AliHMPIDRawStream)
 
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -177,26 +174,23 @@ Bool_t AliHMPIDRawStream::Next()
     fLDCNumber = fRawReader->GetLDCId();
     fTimeStamp = fRawReader->GetTimestamp();
     
-    if(stDeb) Printf("DDL %i started to be decoded!",fDDLNumber); 
+    AliDebug(1,Form("DDL %i started to be decoded!",fDDLNumber));
     rawDataSize=fRawReader->GetDataSize()/4;
     DelVars();                                        //We have to delete the variables initialized in the InitVars before recall IntiVars!!!
     InitVars(rawDataSize);                            //To read the charge and pads we cannot delete before the status return
     
     status = ReadHMPIDRawData();
    
-    if(stDeb) {
-      if(status) Printf("Event DDL %i successfully decoded!.",fDDLNumber);
-      else Printf("Event DDL %i ERROR in decoding!.",fDDLNumber);
+    if(status) AliDebug(1,Form("Event DDL %i successfully decoded!.",fDDLNumber));
+    else AliDebug(1,Form("Event DDL %i ERROR in decoding!.",fDDLNumber));
 //      DumpData(fRawReader->GetDataSize());
-    }
-//    stDeb=kFALSE;
   
    
     }
     if(status==kTRUE) {fnDDLOutStream[fDDLNumber]++; }//Printf("fnDDLOutStream[%d]=%d",fDDLNumber,fnDDLOutStream[fDDLNumber]); } //Count the number of events when the DDL was succesfully decoded
    
-    return status;
- //   return kTRUE;
+//    return status;  // temporary solution...
+   return kTRUE;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDRawStream::InitVars(Int_t n)
@@ -230,6 +224,10 @@ void AliHMPIDRawStream::DelVars()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::ReadHMPIDRawData()
 {
+  //Here the loop on the decoding the raw bank 
+  //for one ddl starts.
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
   Int_t cntGlob = fRawReader->GetDataSize()/4;
   if(cntGlob==0) {fNumOfErr[fDDLNumber][kRawDataSizeErr]++; return kFALSE; }
   
@@ -247,7 +245,7 @@ Bool_t AliHMPIDRawStream::ReadHMPIDRawData()
     if(!CheckSegment()) return kFALSE;
     if(!ReadSegment(cntSegment)) return kFALSE;
 
-    if(nwSeg != cntSegment) {if(stDeb){Printf("Error in Segment counters: %i different wrt %i",nwSeg,cntSegment);} return kFALSE;}
+    if(nwSeg != cntSegment) {AliDebug(1,Form("Error in Segment counters: %i different wrt %i",nwSeg,cntSegment)); return kFALSE;}
     if(!GetWord(cntSegment+1,kBwd)) return kFALSE;
     cnt-=cntSegment+1;
   }
@@ -258,6 +256,9 @@ Bool_t AliHMPIDRawStream::ReadHMPIDRawData()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::ReadSegment(Int_t &cntSegment)
 {
+  //Read the segment
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
   cntSegment = (fWord >> kbit8) & 0xfff;
   Int_t cnt = cntSegment;
   Int_t cntRow;
@@ -271,7 +272,7 @@ Bool_t AliHMPIDRawStream::ReadSegment(Int_t &cntSegment)
     if(!CheckRowMarker()) return kFALSE;
     if(!ReadRow(nwRow)) return kFALSE;
 
-    if(nwRow != cntRow) {if(stDeb){Printf("Error in Row counters: %i different wrt %i",nwRow,cntRow);} return kFALSE;}
+    if(nwRow != cntRow) {AliDebug(1,Form("Error in Row counters: %i different wrt %i",nwRow,cntRow)); return kFALSE;}
     if(!GetWord(cntRow+1)) return kFALSE;
     cnt -= cntRow+1;
     
@@ -285,6 +286,10 @@ Bool_t AliHMPIDRawStream::ReadSegment(Int_t &cntSegment)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::ReadRow(Int_t &cntRow)
 {
+  // Read the row
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
+
   Int_t cnt;
   Int_t cntDilogic;
   Int_t nwDil;
@@ -299,7 +304,7 @@ Bool_t AliHMPIDRawStream::ReadRow(Int_t &cntRow)
     if(!CheckEoE(nwDil)) return kFALSE;
     if(!ReadDilogic(cntDilogic)) return kFALSE;
     
-    if(nwDil != cntDilogic) {if(stDeb){Printf("Error in Dilogic counters: %i different wrt %i",nwDil,cntDilogic);}return kFALSE;}
+    if(nwDil != cntDilogic) {AliDebug(1,Form("Error in Dilogic counters: %i different wrt %i",nwDil,cntDilogic));return kFALSE;}
     cnt -= cntDilogic;
     if(!GetWord(1,kBwd)) return kFALSE; // go to next Dilogic bank...
     cnt--;
@@ -314,6 +319,10 @@ Bool_t AliHMPIDRawStream::ReadRow(Int_t &cntRow)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::ReadDilogic(Int_t &cntDilogic)
 {
+  // Read the dilogic bank
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
+
   cntDilogic = fWord & 0x7f;
   
   Int_t cnt = cntDilogic;
@@ -340,7 +349,7 @@ Bool_t AliHMPIDRawStream::ReadDilogic(Int_t &cntDilogic)
     
     if(charge==0) 
     {
-      if(stDeb){AliWarning(Form("If PEDESTAL run -> WARNING: ZERO charge is read from DDL: %d row: %d dil: %d pad: %d",fDDLNumber,row,dilogic,pad));}
+      AliWarning(Form("If PEDESTAL run -> WARNING: ZERO charge is read from DDL: %d row: %d dil: %d pad: %d",fDDLNumber,row,dilogic,pad));
       fNumOfErr[fDDLNumber][kPedQZero]++;
     }
     
@@ -352,6 +361,10 @@ Bool_t AliHMPIDRawStream::ReadDilogic(Int_t &cntDilogic)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::CheckSegment()
 {
+  // Check the segment marker
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
+
   UInt_t markSegment = 0xAB0;
   /*
   if (iRow%8 == 0) {
@@ -366,7 +379,7 @@ Bool_t AliHMPIDRawStream::CheckSegment()
   UInt_t segMarker = (fWord >> kbit20) & 0xfff;
   if (segMarker != markSegment ) {
     //fRawReader->AddMajorErrorLog(kWrongSegErr,Form("Segment marker %0X wrong (expected %0X) at %i in word %0X!",segMarker,markSegment,fPosition,fWord));
-    if(stDeb){ AliWarning(Form("Segment marker %X wrong (expected %0X)! at %i in word %0X!",segMarker,markSegment,fPosition,fWord));}
+    AliWarning(Form("Segment marker %X wrong (expected %0X)! at %i in word %0X!",segMarker,markSegment,fPosition,fWord));
     fNumOfErr[fDDLNumber][kWrongSegErr]++;
     return kFALSE;
   }
@@ -374,7 +387,7 @@ Bool_t AliHMPIDRawStream::CheckSegment()
   UInt_t segAddress = fWord & 0xff;
   if (segAddress<1 ||segAddress>3) {
     //fRawReader->AddMajorErrorLog(kWrongSegErr,Form("Segment address %d not in the valid range [1-3] at %i in word %0X",segAddress,fPosition,fWord));
-    if(stDeb){AliWarning(Form("Segment address %d not in the valid range [1-3]",segAddress));}
+    AliWarning(Form("Segment address %d not in the valid range [1-3]",segAddress));
     fNumOfErr[fDDLNumber][kWrongSegErr]++;
     return kFALSE;
   }
@@ -384,12 +397,14 @@ Bool_t AliHMPIDRawStream::CheckSegment()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::CheckRow(UInt_t row)
 {
-//check on row number      
+  //check on row number      
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
 //  Printf("ROW %i word %0X",row,fWord);
   if(row>=1 && row <=kNRows) return kTRUE;
   
   //fRawReader->AddMajorErrorLog(kWrongRowErr,Form("row %d",row));
-  if(stDeb){AliWarning(Form("Wrong row index: %d, expected (1 -> %d) word %0X at %i...",row,kNRows,fWord,fPosition));}
+  AliWarning(Form("Wrong row index: %d, expected (1 -> %d) word %0X at %i...",row,kNRows,fWord,fPosition));
   fNumOfErr[fDDLNumber][kWrongRowErr]++;
   return kFALSE;
 }
@@ -397,10 +412,12 @@ Bool_t AliHMPIDRawStream::CheckRow(UInt_t row)
 Bool_t AliHMPIDRawStream::CheckDilogic(UInt_t dilogic)
 {
 //check dilogic number     
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
   if (dilogic>= 1 && dilogic <=kNDILOGICAdd) return kTRUE;
 
   //fRawReader->AddMajorErrorLog(kWrongDilogicErr,Form("dil %d",dilogic));
-  if(stDeb){AliWarning(Form("Wrong DILOGIC index: %d, expected (1 -> %d)!",dilogic,kNDILOGICAdd));}
+  AliWarning(Form("Wrong DILOGIC index: %d, expected (1 -> %d)!",dilogic,kNDILOGICAdd));
   fNumOfErr[fDDLNumber][kWrongDilogicErr]++;
   //dilogic = iDILOGIC;
   return kFALSE;
@@ -409,19 +426,24 @@ Bool_t AliHMPIDRawStream::CheckDilogic(UInt_t dilogic)
 Bool_t AliHMPIDRawStream::CheckPad(UInt_t pad)
 {
 //check pad number     
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
   if (pad < kNPadAdd) return kTRUE;
   
   //fRawReader->AddMajorErrorLog(kWrongPadErr,Form("pad %d",pad));
-  if(stDeb){AliWarning(Form("Wrong pad index: %d, expected (0 -> %d)!",pad,kNPadAdd));}
+  AliWarning(Form("Wrong pad index: %d, expected (0 -> %d)!",pad,kNPadAdd));
   fNumOfErr[fDDLNumber][kWrongPadErr]++;
   return kFALSE;
 }    
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::CheckEoE(Int_t &nDil)
 {
+  //check the End of Event
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
   if (!((fWord >> kbit27) & 0x1)) {                                                //check 27th bit in EoE. It must be 1!
     //fRawReader->AddMajorErrorLog(kEoEFlagErr);
-    if(stDeb){AliWarning(Form("Missing end-of-event flag! (%08X) at %i",fWord,fPosition));}
+    AliWarning(Form("Missing end-of-event flag! (%08X) at %i",fWord,fPosition));
     fNumOfErr[fDDLNumber][kEoEFlagErr]++;
     return kFALSE;
   }
@@ -429,7 +451,7 @@ Bool_t AliHMPIDRawStream::CheckEoE(Int_t &nDil)
   if(nDil < 0 || nDil > 48 ) { 
 
     //fRawReader->AddMajorErrorLog(kEoESizeErr,Form("EoE size=%d",nDil));
-    if(stDeb){AliWarning(Form("Wrong end-of-event word-count: %08X",fWord));}
+    AliWarning(Form("Wrong end-of-event word-count: %08X",fWord));
     fNumOfErr[fDDLNumber][kEoESizeErr]++;
     return kFALSE;
   }
@@ -453,6 +475,9 @@ Bool_t AliHMPIDRawStream::CheckEoE(Int_t &nDil)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Bool_t AliHMPIDRawStream::CheckRowMarker()
 {
+  //check the row marker
+  //It returns: kFALSE if any error occurs
+  //            kTRUE  if all OK
   UInt_t nMAXwordsInRow = 0x1EA;
   UInt_t statusControlRow = 0x32a8; // 0x36a8 for zero suppression
 //First check on row marker    
@@ -460,16 +485,16 @@ Bool_t AliHMPIDRawStream::CheckRowMarker()
   
   if(rowControlWord != statusControlRow) {
     //fRawReader->AddMajorErrorLog(kRowMarkerErr);
-    if(stDeb){AliWarning(Form("Wrong row marker %x expected 0x32a8!",rowControlWord));
+    AliWarning(Form("Wrong row marker %x expected 0x32a8!",rowControlWord));
               fNumOfErr[fDDLNumber][kRowMarkerErr]++;
-              return kFALSE; }
+              return kFALSE;
    }
 //Second check on row marker    
    UInt_t wordsInRow = fWord >> kbit16 & 0x0fff;                // Number of words after the row marker, bit 10 is skipped in this check
   
   if (wordsInRow > nMAXwordsInRow) {
     //fRawReader->AddMajorErrorLog(kRowMarkerSizeErr);
-    if(stDeb){AliWarning(Form(" FATAL: Number of words %x in a row exceeds the expected value: 0x1EA !",wordsInRow));}
+    AliWarning(Form(" FATAL: Number of words %x in a row exceeds the expected value: 0x1EA !",wordsInRow));
     fNumOfErr[fDDLNumber][kRowMarkerSizeErr]++;
     return kFALSE;
   }
@@ -493,7 +518,7 @@ Bool_t AliHMPIDRawStream::GetWord(Int_t n,EDirection dir)
   if(fPosition==-4) return kTRUE;
   
   if(fPosition<0 || fPosition > fRawReader->GetDataSize()) {
-    if(stDeb) Printf("fPosition out of boundaries %i",fPosition);
+    AliWarning(Form("fPosition out of boundaries %i",fPosition));
     return kFALSE;
   }
     
@@ -509,6 +534,9 @@ Bool_t AliHMPIDRawStream::GetWord(Int_t n,EDirection dir)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDRawStream::DumpData(Int_t nw)
 {
+  //just a simple raw data dump
+  // in () is the position in bytes
+  //--
    for(Int_t i=0;i<nw;i+=4) {
      if(!(i%16)) printf(" \n %8i) ",i);
      printf("%02X%02X%02X%02X [ %06i ] ",fData[i+3],fData[i+2],fData[i+1],fData[i+0],fPos[i]);
@@ -518,6 +546,9 @@ void AliHMPIDRawStream::DumpData(Int_t nw)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDRawStream::StorePosition()
 {
+  //just for debug purpose
+  // it stores the position
+  //read for the first time
 //  Printf("@@@@@@@@@ fPos: %x fPosition: %d",fPos,fPosition);
   if(fPos[fPosition]!=0) {
 //    Printf("Position already stored!!! Value %i at address %i",fPos[fPosition],fPosition); 
index a4bb55b..9346440 100644 (file)
@@ -35,9 +35,9 @@ class AliHMPIDRawStream: public TObject {
             void     DelVars();
     
            Int_t GetDDLNumber()  const { return fDDLNumber; }                                                                          // Provide current DDL number
-   static  inline Int_t GetPad(Int_t ddl,Int_t row,Int_t dil,Int_t pad);                                                                 //
-   static  inline Int_t GetNDDL()     { return kNDDL;}                                 //return the number of max # of DDLs
-   static  inline Int_t GetNErrors()  { return kSumErr;}                               //return the number of max # of Error Types
+   static  inline Int_t GetPad(Int_t ddl,Int_t row,Int_t dil,Int_t pad);                                                                 //get absolute pad number
+   static  Int_t GetNDDL()     { return kNDDL;}                                 //return the number of max # of DDLs
+   static  Int_t GetNErrors()  { return kSumErr;}                               //return the number of max # of Error Types
 
            Int_t   GetNPads()         const { return fNPads;}                         //Get number of pads present in the stream
             Int_t*  GetPadArray()      const { return fPad;}                           //Get pad array from stream decoded
@@ -52,9 +52,9 @@ class AliHMPIDRawStream: public TObject {
     inline  Bool_t SetZeroSup (Bool_t isSup);
     inline  Bool_t GetZeroSup(); 
     inline  Int_t  GetErrors(Int_t ddl,Int_t eType);                                                                                   //Get errors and occurance
-    inline  Int_t  GetDDLNumber() { return fDDLNumber;} //return the number of DDL actually being decoded
-    inline  UInt_t GetLDCNumber() { return fLDCNumber;} //return the number of LDC actually being decoded
-    inline  UInt_t GetTimeStamp() { return fTimeStamp;} //return the time stamp of the event actually being decoded
+    Int_t  GetDDLNumber() { return fDDLNumber;} //return the number of DDL actually being decoded
+    UInt_t GetLDCNumber() { return fLDCNumber;} //return the number of LDC actually being decoded
+    UInt_t GetTimeStamp() { return fTimeStamp;} //return the time stamp of the event actually being decoded