From 37890aaf245451e4ae2e7d73ee46bbcc5f8ee0ae Mon Sep 17 00:00:00 2001 From: gustavo Date: Wed, 14 Nov 2007 15:34:05 +0000 Subject: [PATCH] Coding violations corrected --- EMCAL/AliEMCALGeometry.cxx | 25 +++++++++++---------- EMCAL/AliEMCALGeometry.h | 23 +++++++++++-------- EMCAL/AliEMCALRecPoint.cxx | 15 ++++++++----- EMCAL/AliEMCALRecPoint.h | 13 ++++++++--- EMCAL/AliEMCALSuperModule.cxx | 42 ++++++++++++++++++++++++++++++++--- EMCAL/AliEMCALSuperModule.h | 17 +++++++++----- 6 files changed, 96 insertions(+), 39 deletions(-) diff --git a/EMCAL/AliEMCALGeometry.cxx b/EMCAL/AliEMCALGeometry.cxx index 161eb28263e..b6cba1b5b5e 100644 --- a/EMCAL/AliEMCALGeometry.cxx +++ b/EMCAL/AliEMCALGeometry.cxx @@ -36,7 +36,7 @@ #include -// --- AliRoot header files --- +// --- Root header files --- #include #include #include @@ -412,7 +412,6 @@ void AliEMCALGeometry::Init(void){ if(fGeoName.Contains("WSUC")) fNumberOfSuperModules = 1; // Jul 12, 2007 fgInit = kTRUE; - AliInfo(" is ended"); } void AliEMCALGeometry::PrintGeometry() @@ -500,7 +499,6 @@ void AliEMCALGeometry::PrintGeometry() } } } - cout<Add(fShishKebabTrd1Modules); } Bool_t AliEMCALGeometry::IsFolder() const { + //Check if fShishKebabTrd1Modules is in folder if(fShishKebabTrd1Modules) return kTRUE; else return kFALSE; } Double_t AliEMCALGeometry::GetPhiCenterOfSM(Int_t nsupmod) const { + //returns center of supermodule in phi static int i = nsupmod/2; return fPhiCentersOfSM[i]; diff --git a/EMCAL/AliEMCALGeometry.h b/EMCAL/AliEMCALGeometry.h index 12069361f1c..2c313886f19 100644 --- a/EMCAL/AliEMCALGeometry.h +++ b/EMCAL/AliEMCALGeometry.h @@ -20,14 +20,20 @@ class TObjArray; class TVector3; class TGeoMatrix; class TParticle ; -class AliEMCALGeometry; -class AliEMCALShishKebabTrd1Module; -class AliEMCALRecPoint; class TClonesArray ; +#include +#include +class assert; +class Riostream; +class TClonesArray; +class TGeoNode; +class TGeoManager; // --- AliRoot header files --- -#include -#include +class AliEMCALGeometry; +class AliEMCALShishKebabTrd1Module; +class AliEMCALRecPoint; +class AliEMCALDigit; #include "AliGeometry.h" @@ -47,7 +53,7 @@ public: static Char_t* GetDefaulGeometryName() {return fgDefaultGeometryName;} void PrintGeometry(); //*MENU* void PrintCellIndexes(Int_t absId=0, int pri=0, char *tit=""); //*MENU* - virtual void Browse(TBrowser* b); + virtual void Browse(TBrowser* b) const ; virtual Bool_t IsFolder() const; void GetCellPhiEtaIndexInSModuleFromTRUIndex(Int_t itru, Int_t iphitru, Int_t ietatru, Int_t &ietaSM, Int_t &iphiSM) const ; // Tranforms Eta-Phi Cell index in TRU into Eta-Phi index in Super Module @@ -306,9 +312,8 @@ private: char *fAdditionalOpts[6]; //! some additional options for the geometry type and name int fNAdditionalOpts; //! size of additional options parameter - // Options for Geant (MIP business) - will call in AliEMCAL - Int_t fILOSS; - Int_t fIHADR; + Int_t fILOSS; // Options for Geant (MIP business) - will call in AliEMCAL + Int_t fIHADR; // Options for Geant (MIP business) - will call in AliEMCAL ClassDef(AliEMCALGeometry, 13) // EMCAL geometry class }; diff --git a/EMCAL/AliEMCALRecPoint.cxx b/EMCAL/AliEMCALRecPoint.cxx index 94b38907f96..d4d633e5344 100644 --- a/EMCAL/AliEMCALRecPoint.cxx +++ b/EMCAL/AliEMCALRecPoint.cxx @@ -155,6 +155,8 @@ AliEMCALRecPoint::~AliEMCALRecPoint() //____________________________________________________________________________ AliEMCALRecPoint& AliEMCALRecPoint::operator= (const AliEMCALRecPoint &rp) { + // assignment operator + if(&rp == this) return *this; fGeomPtr = rp.fGeomPtr; @@ -711,15 +713,15 @@ void AliEMCALRecPoint::GetDeffW0(const Double_t esum , Double_t &deff, Double_t // Look to: http://rhic.physics.wayne.edu/~pavlinov/ALICE/SHISHKEBAB/RES/CALIB/GEOMCORR/deffandW0VaEgamma_2.gif // static Double_t e=0.0; - const Double_t dp0=9.25147, dp1=1.16700; // Hard coded now - const Double_t wp0=4.83713, wp1=-2.77970e-01, wp2 = 4.41116; + const Double_t kdp0=9.25147, kdp1=1.16700; // Hard coded now + const Double_t kwp0=4.83713, kwp1=-2.77970e-01, kwp2 = 4.41116; // No extrapolation here e = esum<0.5?0.5:esum; e = e>100.?100.:e; - deff = dp0 + dp1*TMath::Log(e); - w0 = wp0 / (1. + TMath::Exp(wp1*(e+wp2))); + deff = kdp0 + kdp1*TMath::Log(e); + w0 = kwp0 / (1. + TMath::Exp(kwp1*(e+kwp2))); //printf(" AliEMCALRecPoint::GetDeffW0 esum %5.2f : deff %5.2f : w0 %5.2f \n", esum, deff, w0); } @@ -1157,7 +1159,7 @@ Double_t AliEMCALRecPoint::TmaxInCm(const Double_t e , const Int_t key) // key = 0(gamma, default) // != 0(electron) static Double_t ca = 4.82; // shower max parameter - first guess; ca=TMath::Log(1000./8.07) - static Double_t X0 = 1.23; // radiation lenght (cm) + static Double_t x0 = 1.23; // radiation lenght (cm) static Double_t tmax = 0.; // position of electromagnetic shower max in cm tmax = 0.0; @@ -1165,7 +1167,7 @@ Double_t AliEMCALRecPoint::TmaxInCm(const Double_t e , const Int_t key) tmax = TMath::Log(e) + ca; if (key==0) tmax += 0.5; else tmax -= 0.5; - tmax *= X0; // convert to cm + tmax *= x0; // convert to cm } return tmax; } @@ -1228,6 +1230,7 @@ void AliEMCALRecPoint::Print(Option_t *opt) const //___________________________________________________________ Double_t AliEMCALRecPoint::GetPointEnergy() const { + //Returns energy .... static double e; e=0.0; for(int ic=0; ic +class TGeoManager; +class TGeoPhysicalNode; +class TPad; +class TPaveText; +class TGraph; +class Riostream; // --- Standard library --- @@ -20,6 +26,7 @@ class AliEMCALDigit; class AliDigitNew; class AliEMCALGeometry; +class AliEMCALHit; class AliEMCALRecPoint : public AliCluster { @@ -35,7 +42,7 @@ class AliEMCALRecPoint : public AliCluster { virtual ~AliEMCALRecPoint(); - virtual void AddDigit(AliDigitNew &){ + virtual void AddDigit(AliDigitNew &) const { Fatal("AddDigit", "use AddDigit(AliEMCALDigit & digit, Float_t Energy )") ; } virtual void AddDigit(AliEMCALDigit & digit, Float_t Energy); @@ -88,8 +95,8 @@ class AliEMCALRecPoint : public AliCluster { Int_t GetMultiplicityAtLevel(Float_t level) const ; // computes multiplicity of digits with Int_t * GetAbsId() const {return fAbsIdList;} Int_t GetAbsId(int i) const {if(i>=0 && i TFolder; Sep 6, 2007 // +// +// //*-- Author: Aleksei Pavlinov (WSU, Detroit, USA) #include "AliEMCALSuperModule.h" @@ -45,12 +50,32 @@ ClassImp(AliEMCALSuperModule) AliEMCALSuperModule::AliEMCALSuperModule() : TFolder() , fParent(0),fLh(0),fSMNumber(0) { + //default ctor } AliEMCALSuperModule::AliEMCALSuperModule(const Int_t m, const char* title) : TFolder(Form("SM%2.2i",m), title) , fParent(0),fLh(0),fSMNumber(m) { + //ctor +} + +AliEMCALSuperModule::AliEMCALSuperModule(const AliEMCALSuperModule &sm) : +TFolder(), fParent(sm.fParent),fLh(sm.fLh),fSMNumber(sm.fSMNumber) +{ + //copy ctor +} + +AliEMCALSuperModule & AliEMCALSuperModule::operator =(const AliEMCALSuperModule &sm) +{ + // assignment operator +// if(this == &sm)return *this; +// ((TObject *)this)->operator=(sm); + + fParent = sm.fParent; + fLh = sm.fLh; + fSMNumber = sm.fSMNumber; + } AliEMCALSuperModule::~AliEMCALSuperModule() @@ -60,6 +85,8 @@ AliEMCALSuperModule::~AliEMCALSuperModule() void AliEMCALSuperModule::Init() { + //Initialization method + if(GetHists()==0) { fLh = BookHists(); Add(fLh); @@ -68,6 +95,7 @@ void AliEMCALSuperModule::Init() void AliEMCALSuperModule::AddCellToEtaRow(AliEMCALCell *cell, const Int_t etaRow) { + //Adds cells to corresponding Super module Eta Row static TFolder *set; set = dynamic_cast(FindObject(Form("ETA%2.2i",etaRow))); if(set==0) { @@ -79,6 +107,8 @@ void AliEMCALSuperModule::AddCellToEtaRow(AliEMCALCell *cell, const Int_t etaRo void AliEMCALSuperModule::FitForAllCells() { + //Fit histograms of each cell + Int_t ncells=0; for(int eta=0; eta<48; eta++) { // eta row TFolder *setEta = dynamic_cast(FindObject(Form("ETA%2.2i",eta))); @@ -109,6 +139,7 @@ void AliEMCALSuperModule::FitForAllCells() void AliEMCALSuperModule::FitEffMassHist() { + //Fit effective mass histogram TH1* h = (TH1*)GetHists()->At(0); AliEMCALCell::FitHist(h, GetName()); } @@ -116,6 +147,7 @@ void AliEMCALSuperModule::FitEffMassHist() void AliEMCALSuperModule::PrintInfo() { + //Print printf(" Super Module : %s : %i \n", GetName(), fSMNumber); printf(" # of active cells %i \n", GetNumberOfCells()); TH1* h = (TH1*)GetHists()->At(0); @@ -124,6 +156,7 @@ void AliEMCALSuperModule::PrintInfo() void AliEMCALSuperModule::DrawCC(int iopt) { + //Draw different cell histograms TCanvas *c=0; if(iopt==1) c = new TCanvas("ccInOut","ccInOut"); @@ -159,6 +192,7 @@ void AliEMCALSuperModule::DrawCC(int iopt) Int_t AliEMCALSuperModule::GetNumberOfCells() { + //Returns number of cells in SM Int_t ncells=0; TList* l = (TList*)GetListOfFolders(); for(int eta=0; etaGetSize(); eta++) { // cycle on eta row @@ -173,11 +207,13 @@ Int_t AliEMCALSuperModule::GetNumberOfCells() TList* AliEMCALSuperModule::BookHists() { + //Initializes histograms + gROOT->cd(); TH1::AddDirectory(1); - AliEMCALFolder* EMCAL = (AliEMCALFolder*)GetParent(); - Int_t it = EMCAL->GetIterationNumber(); + AliEMCALFolder* emcal = (AliEMCALFolder*)GetParent(); + Int_t it = emcal->GetIterationNumber(); new TH1F("00_EffMass", "effective mass of #gamma,#gamma(m_{#pi^{0}}=134.98 MeV) ", 250,0.0,0.5); new TH1F("01_CCInput", "input CC dist.(MEV) ", 200, 5., 25.); diff --git a/EMCAL/AliEMCALSuperModule.h b/EMCAL/AliEMCALSuperModule.h index 226f4f59718..21e077fd443 100644 --- a/EMCAL/AliEMCALSuperModule.h +++ b/EMCAL/AliEMCALSuperModule.h @@ -12,21 +12,26 @@ // Super Module folder // Initial version was created with TDataSet staf // TObjectSet -> TFolder; Sep 6, 2007 - +// +// #include class TList; +class TStyle ; +class TROOT; + class AliEMCALCell; class AliEMCALSuperModule : public TFolder { public: - AliEMCALSuperModule(); - AliEMCALSuperModule(const Int_t m, const char* title="Emcal Super Module"); - - virtual ~AliEMCALSuperModule(); + AliEMCALSuperModule(); // default ctor + AliEMCALSuperModule(const Int_t m, const char* title="Emcal Super Module");//ctor + AliEMCALSuperModule( const AliEMCALSuperModule & sm);// cpy ctor + AliEMCALSuperModule &operator = (const AliEMCALSuperModule & sm);// cpy assignment + virtual ~AliEMCALSuperModule();//virtual dtor void Init(); void AddCellToEtaRow(AliEMCALCell *cell, const Int_t etaRow); @@ -46,7 +51,7 @@ class AliEMCALSuperModule : public TFolder { // TObject* fParent; // parent TList* fLh; // List of hists - Int_t fSMNumber; + Int_t fSMNumber; //Super Module Number ClassDef(AliEMCALSuperModule,2) // EMCAL SuperModule -- 2.43.0