fixes of violations
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Mar 2011 08:55:28 +0000 (08:55 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 21 Mar 2011 08:55:28 +0000 (08:55 +0000)
PWG2/FORWARD/analysis/AliFMDAnaParameters.cxx
PWG2/FORWARD/analysis/AliFMDAnaParameters.h
PWG2/FORWARD/analysis/AliFMDAnalysisTaskCollector.cxx
PWG2/FORWARD/analysis/AliFMDAnalysisTaskCollector.h

index 947d043..7140335 100644 (file)
@@ -245,7 +245,7 @@ void AliFMDAnaParameters::InitEventSelectionEff() {
 //____________________________________________________________________
 
 void AliFMDAnaParameters::InitSharingEff() {
-  
+  //Initialize the sharing efficiency
   fSharingObjectPresent = kTRUE;
   TFile* fin = TFile::Open(GetPath(fgkSharingEffID));
                            
@@ -263,7 +263,7 @@ void AliFMDAnaParameters::InitSharingEff() {
 }
 //____________________________________________________________________
 void AliFMDAnaParameters::FindEtaLimits() {
-
+  //Find eta limits for analysis
   fEtaLowBinLimits.SetBins(4,0,4,2,0,2,GetNvtxBins(),0,GetNvtxBins());
   fEtaHighBinLimits.SetBins(4,0,4,2,0,2,GetNvtxBins(),0,GetNvtxBins());
   for(Int_t det=0; det<=3;det++) {
@@ -282,6 +282,7 @@ void AliFMDAnaParameters::FindEtaLimits() {
 //____________________________________________________________________
 void AliFMDAnaParameters::SetEnergy(Float_t cmsNNGeV) 
 {
+  //Set energy
   if (TMath::Abs(cmsNNGeV - 900.)   < 10)  fEnergy = k900;
   if (TMath::Abs(cmsNNGeV - 2400.)  < 10)  fEnergy = k2400;
   if (TMath::Abs(cmsNNGeV - 2750.)  < 10)  fEnergy = k2750;
@@ -293,6 +294,7 @@ void AliFMDAnaParameters::SetEnergy(Float_t cmsNNGeV)
 //____________________________________________________________________
 void AliFMDAnaParameters::SetMagField(Float_t bkG) 
 {
+  //Set magnetic field
   if (TMath::Abs(bkG - 5.) < 1 ) fMagField = k5G;
   if (TMath::Abs(bkG + 5.) < 1 ) fMagField = k5Gnegative;
   if (TMath::Abs(bkG) < 1)       fMagField = k0G;
@@ -300,6 +302,7 @@ void AliFMDAnaParameters::SetMagField(Float_t bkG)
 //____________________________________________________________________
 void AliFMDAnaParameters::SetCollisionSystem(const TString& sys) 
 {
+  //Set the collision system
   TString s(sys);
   s.ToLower();
   if      (s.Contains("p-p")   || s.Contains("pp"))   fSpecies = kPP; 
@@ -310,7 +313,7 @@ void AliFMDAnaParameters::SetCollisionSystem(const TString& sys)
 //____________________________________________________________________
 void AliFMDAnaParameters::SetParametersFromESD(AliESDEvent* esd) 
 {
-
+  //Set the parameters from the ESD header information
 
   SetCollisionSystem(esd->GetBeamType());
 
@@ -400,16 +403,16 @@ void AliFMDAnaParameters::PrintStatus(Bool_t showpaths) const
     datastring.Form("Unknown"); break ;
   }
   
-  TString InelString;
-  if(fInelGtZero) InelString = "INEL > 0";
-  else InelString = "INEL";
+  TString inelString;
+  if(fInelGtZero) inelString = "INEL > 0";
+  else inelString = "INEL";
   
   std::cout<<"Energy       = "<<energystring.Data()<<std::endl;
   std::cout<<"Trigger      = "<<triggerstring.Data()<<std::endl;
   std::cout<<"Mag Field    = "<<magstring.Data()<<std::endl;
   std::cout<<"Coll System  = "<<collsystemstring.Data()<<std::endl;
   std::cout<<"Data origin  = "<<datastring.Data()<<std::endl;
-  std::cout<<"Basic trigger: "<<InelString.Data()<<std::endl;
+  std::cout<<"Basic trigger: "<<inelString.Data()<<std::endl;
 
   if (showpaths) {
     TString bg = GetPath(fgkBackgroundID);
@@ -676,7 +679,7 @@ Float_t AliFMDAnaParameters::GetEventSelectionEfficiency(Int_t vtxbin) {
 }
 //_____________________________________________________________________
 Float_t AliFMDAnaParameters::GetVtxSelectionEffFromMC() {
-
+  //Get the vtx selection from MC calculation
    if(!fIsInit) {
     AliWarning("Not initialized yet. Call Init() to remedy");
     return 0;
@@ -1048,7 +1051,7 @@ AliFMDAnaParameters::GetStripLength(Char_t ring, UShort_t strip)
 }
 //____________________________________________________________________
 Float_t 
-AliFMDAnaParameters::GetBaseStripLength(Char_t ring, UShort_t strip)  
+AliFMDAnaParameters::GetBaseStripLength(Char_t ring, UShort_t strip) const  
 {  
   //Get length of strip assuming that corners are not cut away
   Float_t rad             = GetMaxR(ring)-GetMinR(ring);
@@ -1064,6 +1067,7 @@ AliFMDAnaParameters::GetBaseStripLength(Char_t ring, UShort_t strip)
 //____________________________________________________________________
 Int_t    AliFMDAnaParameters::GetFirstEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring)
 {
+  //Get the first eta bin from the bg map
   TH2F* hBg = GetBackgroundCorrection(det,ring,vtxbin);
   
   if(det == 0) return hBg->GetXaxis()->FindBin(-1.95);
@@ -1091,6 +1095,7 @@ Int_t    AliFMDAnaParameters::GetFirstEtaBinFromMap(Int_t vtxbin, Int_t det, Cha
 //____________________________________________________________________
 Int_t    AliFMDAnaParameters::GetLastEtaBinFromMap(Int_t vtxbin, Int_t det, Char_t ring)
 {
+  //Get the last eta bin from the map
   TH2F* hBg = GetBackgroundCorrection(det,ring,vtxbin);
   Int_t lastbin=-1;
   Int_t nNonZeroLast = 0;
index 4ccb962..39df3eb 100644 (file)
@@ -106,7 +106,7 @@ public:
   Float_t  GetPhiFromSector(UShort_t det, Char_t ring, UShort_t sec) const;
   Float_t  GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Float_t zvtx) const;
   Float_t  GetStripLength(Char_t ring, UShort_t strip)  ;
-  Float_t  GetBaseStripLength(Char_t ring, UShort_t strip)  ;
+  Float_t  GetBaseStripLength(Char_t ring, UShort_t strip) const  ;
   Float_t  GetMaxR(Char_t ring) const;
   Float_t  GetMinR(Char_t ring) const;
   void     SetBackgroundPath(const Char_t* bgpath) {fBackgroundPath = bgpath;}
@@ -125,16 +125,16 @@ public:
   void     SetRunBFCorrelation(Bool_t runBFcor) { fRunBFCorrelation = runBFcor;  }
   void     SetRunMultiplicity(Bool_t runMultiplicity) { fRunMultiplicity = runMultiplicity;  }
   
-  Bool_t   GetRunDndeta()        {return fRunDndeta;}
-  Bool_t   GetRunBFCorrelation() {return fRunBFCorrelation;}
-  Bool_t   GetRunMultiplicity()  {return fRunMultiplicity;}
+  Bool_t   GetRunDndeta() const        {return fRunDndeta;}
+  Bool_t   GetRunBFCorrelation() const {return fRunBFCorrelation;}
+  Bool_t   GetRunMultiplicity() const {return fRunMultiplicity;}
 
   //Bool_t   IsEventTriggered(const AliESDEvent *esd) ;
   Bool_t   IsEventTriggered(Trigger trigger) ;
   void     SetTriggerStatus(const AliESDEvent *esd) ;
   void     SetEnergy(Energy energy) {fEnergy = energy;}
   void     SetEnergy(Float_t cmsNNGeV);
-  Energy   GetEnergy() {return fEnergy;}
+  Energy   GetEnergy() const {return fEnergy;}
   void     SetMagField(MagField magfield) {fMagField = magfield;}
   void     SetMagField(Float_t bkG);
   const char*    GetPath(const char* species) const;
@@ -155,7 +155,7 @@ public:
   void     SetLowSPDLimit(Float_t cut) {fSPDlowLimit = cut;}
   void     SetHighSPDLimit(Float_t cut) {fSPDhighLimit = cut;}
   void     SetCentralTriggerSelection(Bool_t selection) {fCentralSelection = selection;}
-  Bool_t   SharingEffPresent() {return fSharingObjectPresent;}
+  Bool_t   SharingEffPresent() const {return fSharingObjectPresent;}
   Int_t    GetFirstEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ;
   Int_t    GetLastEtaBinToInclude(Int_t vtxbin, Int_t det, Char_t ring) ;
   void     SetUseInternalNSDTrigger(Bool_t internalNSD) {fUseBuiltInNSD = internalNSD;}
index 1ab72f5..296c06a 100644 (file)
@@ -51,8 +51,9 @@
 ClassImp(AliFMDAnalysisTaskCollector)
 
 //____________________________________________________________________
-Double_t  AliFMDAnalysisTaskCollector::TripleLandau(Double_t *x, Double_t *par) {
-  
+Double_t  AliFMDAnalysisTaskCollector::TripleLandau(const Double_t *x, Double_t *par) {
+  //A convolution of three landaus to fit three MIP peaks
+
   Double_t energy        = x[0];
   Double_t constant = par[0];
   Double_t mpv      = par[1];
@@ -69,7 +70,7 @@ Double_t  AliFMDAnalysisTaskCollector::TripleLandau(Double_t *x, Double_t *par)
 //____________________________________________________________________
 
 AliFMDAnalysisTaskCollector::AliFMDAnalysisTaskCollector()
-: fDebug(0),
+  : //fDebug(0),
   fOutputList(0),
   fArray(0),
   fZvtxDist(0),
@@ -87,7 +88,7 @@ AliFMDAnalysisTaskCollector::AliFMDAnalysisTaskCollector()
 //____________________________________________________________________
 AliFMDAnalysisTaskCollector::AliFMDAnalysisTaskCollector(const char* name):
     AliAnalysisTaskSE(name),
-    fDebug(0),
+    //fDebug(0),
     fOutputList(0),
     fArray(0),
     fZvtxDist(0),
@@ -163,7 +164,7 @@ void AliFMDAnalysisTaskCollector::UserCreateOutputObjects()
 //____________________________________________________________________
 void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
 {
-  
+  //Collect data for fitting
   AliESDEvent* esd = (AliESDEvent*)InputEvent();
   AliESD* old = esd->GetAliESDOld();
   if (old) {
@@ -219,7 +220,7 @@ void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
   if(empty)
     std::cout<<spdMult->GetNumberOfSingleClusters()<<"  "<<spdMult->GetNumberOfTracklets()<<std::endl;
   
-  TH1F* Edist = 0;
+  TH1F* edist = 0;
   TH1F* emptyEdist = 0;
   TH1F* ringEdist = 0;
   for(UShort_t det=1;det<=3;det++) {
@@ -245,8 +246,8 @@ void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
          
          //      std::cout<<det<<"  "<<ring<<"   "<<sec<<"    "<<strip<<"   "<<vertex[2]<<"   "<<eta<<"   "<<nEta<<std::endl;
          if(physics) {
-           Edist = (TH1F*)fOutputList->FindObject(Form("FMD%d%c_etabin%d",det,ring,nEta));       
-           Edist->Fill(mult);
+           edist = (TH1F*)fOutputList->FindObject(Form("FMD%d%c_etabin%d",det,ring,nEta));       
+           edist->Fill(mult);
            ringEdist->Fill(mult);
          }
          else if(empty) {
@@ -270,6 +271,8 @@ void AliFMDAnalysisTaskCollector::UserExec(Option_t */*option*/)
 //____________________________________________________________________
   
 void AliFMDAnalysisTaskCollector::Terminate(Option_t */*option*/) {
+  //Terminate
+  
   std::cout<<"Analysed "<<fEvents<<" events and "<<fEmptyEvents<<" empty"<<std::endl;
   std::cout<<fClusters / fEvents << " clusters per physics event and "<<fClustersEmpty / fEmptyEvents<< " clusters per empty event"<<std::endl;
 
@@ -313,10 +316,10 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
   
   TList* list = (TList*)fin.Get("energyDist");
   
-  AliFMDAnaCalibEnergyDistribution* EnergyDist = new AliFMDAnaCalibEnergyDistribution();
+  AliFMDAnaCalibEnergyDistribution* energyDist = new AliFMDAnaCalibEnergyDistribution();
   
-  EnergyDist->SetNetaBins(pars->GetNetaBins());
-  EnergyDist->SetEtaLimits(pars->GetEtaMin(),pars->GetEtaMax());
+  energyDist->SetNetaBins(pars->GetNetaBins());
+  energyDist->SetEtaLimits(pars->GetEtaMin(),pars->GetEtaMax());
   
   TF1* fitFunc = 0;
   
@@ -334,15 +337,15 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
        fitFunc->Write(Form("FMD%d%c_fitfunc",det,ringChar),TObject::kWriteDelete);
       
       
-      EnergyDist->SetEmptyEnergyDistribution(det,ringChar,hEmptyEdist);
-      EnergyDist->SetRingEnergyDistribution(det,ringChar,hRingEdist);
+      energyDist->SetEmptyEnergyDistribution(det,ringChar,hEmptyEdist);
+      energyDist->SetRingEnergyDistribution(det,ringChar,hRingEdist);
       for(Int_t nEta = 0; nEta < pars->GetNetaBins(); nEta++) {
        TH1F* hEdist = (TH1F*)list->FindObject(Form("FMD%d%c_etabin%d",det,ringChar,nEta));
        
        fitFunc = FitEnergyDistribution(hEdist, speciesOption) ;
        if(fitFunc)
          fitFunc->Write(Form("FMD%d%c_etabin%d_fitfunc",det,ringChar,nEta),TObject::kWriteDelete);
-       EnergyDist->SetEnergyDistribution(det,ringChar,nEta,hEdist);
+       energyDist->SetEnergyDistribution(det,ringChar,nEta,hEdist);
        
       }
       
@@ -355,7 +358,7 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
   
   if(store) {
     TFile fcalib(pars->GetPath(pars->GetEdistID() ),"RECREATE");
-    EnergyDist->Write(AliFMDAnaParameters::GetEdistID());
+    energyDist->Write(AliFMDAnaParameters::GetEdistID());
     fcalib.Close();
   }
 
@@ -364,6 +367,7 @@ void AliFMDAnalysisTaskCollector::ReadFromFile(const Char_t* filename, Bool_t st
 }
 //____________________________________________________________________
 TF1* AliFMDAnalysisTaskCollector::FitEnergyDistribution(TH1F* hEnergy, Int_t /*speciesOption*/) {
+  //Fit energy distribution
   AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
   TF1* fitFunc = 0;
   if(hEnergy->GetEntries() != 0) {
index 5dc2093..4d1d8ce 100644 (file)
@@ -12,9 +12,9 @@ class AliESDEvent;
 class TChain;
 class AliAODEvent;
 class AliFMDAnaParameters;
-
-
-
+//
+//Class to fit energy distributions in the FMD
+//
 class AliFMDAnalysisTaskCollector : public AliAnalysisTaskSE
 {
  public:
@@ -22,7 +22,7 @@ class AliFMDAnalysisTaskCollector : public AliAnalysisTaskSE
   AliFMDAnalysisTaskCollector(const char* name);
   AliFMDAnalysisTaskCollector(const AliFMDAnalysisTaskCollector& o) : 
     AliAnalysisTaskSE(),
-    fDebug(o.fDebug),
+    //    fDebug(o.fDebug),
     fOutputList(o.fOutputList),
     fArray(o.fArray),
     fZvtxDist(o.fZvtxDist),
@@ -43,21 +43,21 @@ class AliFMDAnalysisTaskCollector : public AliAnalysisTaskSE
   virtual void SetDebugLevel(Int_t level) {fDebug = level;}
   virtual void Terminate(Option_t */*option*/);
   void ReadFromFile(const Char_t* filename, Bool_t store=kFALSE, Int_t speciesOption = 0);
-  static Double_t  TripleLandau(Double_t *x, Double_t *par);
+  static Double_t  TripleLandau(const Double_t *x, Double_t *par);
   TF1* FitEnergyDistribution(TH1F* hEnergy, Int_t speciesOption);
 
 private:
   void          GetVertex(Double_t* vertexXYZ); 
-  Int_t         fDebug;        //  Debug flag
-  TList*        fOutputList;
-  TObjArray*    fArray;
-  TH1F*         fZvtxDist;
-  Int_t         fEvents;
-  Int_t         fEmptyEvents;
-  Float_t       fClusters;
-  Float_t       fClustersEmpty;
-  Bool_t        fFirstEvent;
-  AliFMDAnaParameters* fParam;
+  //Int_t         fDebug;        //  Debug flag
+  TList*        fOutputList;     //Output list
+  TObjArray*    fArray;          //Array for storage
+  TH1F*         fZvtxDist;       //Dist of z vertex
+  Int_t         fEvents;         //Number of events
+  Int_t         fEmptyEvents;    //Number of events with empty trigger
+  Float_t       fClusters;       //Number of clusters
+  Float_t       fClustersEmpty;  //Number of clusters in empty events
+  Bool_t        fFirstEvent;     //Have we had events yet ?
+  AliFMDAnaParameters* fParam;   //The parameters class for IO
 
   ClassDef(AliFMDAnalysisTaskCollector, 1); // Analysis task for FMD analysis
 };