From 79637e233f9fc3d44c43f8ecd730813f698f8e12 Mon Sep 17 00:00:00 2001 From: martinez Date: Fri, 28 Nov 2003 16:37:04 +0000 Subject: [PATCH] Definitions from AliMUONSt1Types moved to the class, int, unsigned itn, double replaced with types from Root, use AliMUONSt1Decoder typedefs (I. Hrivnacova) --- MUON/AliMUONSt1Response.cxx | 104 ++++++++++++++++++++---------------- MUON/AliMUONSt1Response.h | 17 ++++-- 2 files changed, 71 insertions(+), 50 deletions(-) diff --git a/MUON/AliMUONSt1Response.cxx b/MUON/AliMUONSt1Response.cxx index 86429495ce5..fd1452e3a3b 100644 --- a/MUON/AliMUONSt1Response.cxx +++ b/MUON/AliMUONSt1Response.cxx @@ -23,8 +23,6 @@ // Individual pedestals or noise levels can be controlled separately. // The current pulse height responses do not contain any physics -#include - #include #include #include @@ -162,23 +160,26 @@ void AliMUONSt1Response::SetIniFileName(Int_t plane,const TString& fileName) //__________________________________________________________________________ -void AliMUONSt1Response::ReadCouplesOfIntRanges(const string& value,TList* list,AliMUONSt1ElectronicElement::TDescription descr) +void AliMUONSt1Response::ReadCouplesOfIntRanges(const string& value, + TList* list, + AliMUONSt1ElectronicElement::TDescription descr) { // Decode couplets of integer ranges (enclosed within parenthesis and // separated by a comma, eg. (12/20,33/60) for ranges 12 to 20 and 33 to 60) // and save these ranges in - vector lstCpl = decoder::SplitNtuples(value); - for (unsigned int n=0;n lst = decoder::SplitList(lstCpl[n],","); + + StringVector lstCpl = decoder::SplitNtuples(value); + for (UInt_t n=0;n > lst1 = decoder::DecodeListOfIntRanges(lst[0],";"); - vector > lst2 = decoder::DecodeListOfIntRanges(lst[1],";"); - for (unsigned int u1=0;u1 - vector lstCpl = decoder::SplitNtuples(value); - for (unsigned int n=0;n lst = decoder::SplitList(lstCpl[n],","); + + StringVector lstCpl = decoder::SplitNtuples(value); + for (UInt_t n=0;n > lst1 = decoder::DecodeListOfFloatRanges(lst[0],";"); - vector > lst2 = decoder::DecodeListOfFloatRanges(lst[1],";"); - for (unsigned int u1=0;u1 + TString path = fgkTopDir + fgkDataDir ; const char* nm = name.c_str(); if (fgkStateName.CompareTo(nm,TString::kIgnoreCase)==0){ param->SetState(atoi(value.c_str())); } else if (fgkPedestalName.CompareTo(nm,TString::kIgnoreCase)==0){ - vector lst = decoder::SplitList(value," "); + StringVector lst = decoder::SplitList(value," "); if ((lst.size()>0) && (fgkNotName.CompareTo(lst[0].c_str(),TString::kIgnoreCase)==0)){ param->UnSetPedestal(); } else if ((lst.size()>1) && (fgkValueName.CompareTo(lst[0].c_str(),TString::kIgnoreCase)==0)){ @@ -241,7 +246,7 @@ void AliMUONSt1Response::SetPairToParam(const string& name,const string& value,A param->SetPedestal(atof(lst[1].c_str()),atof(lst[2].c_str())); } } else if (fgkNoiseName.CompareTo(nm,TString::kIgnoreCase)==0){ - vector lst = decoder::SplitList(value," "); + StringVector lst = decoder::SplitList(value," "); if ((lst.size()>1) && (fgkValueName.CompareTo(lst[0].c_str(),TString::kIgnoreCase)==0)){ param->SetNoise(atof(lst[1].c_str())); } else if ((lst.size()>1) && (fgkFileName.CompareTo(lst[0].c_str(),TString::kIgnoreCase)==0)){ @@ -252,16 +257,16 @@ void AliMUONSt1Response::SetPairToParam(const string& name,const string& value,A } else if (fgkNofSigmaName.CompareTo(nm,TString::kIgnoreCase)==0){ param->SetNofSigma(atoi(value.c_str())); } else if (fgkStickyOnName.CompareTo(nm,TString::kIgnoreCase)==0){ - vector< pair > lst = decoder::DecodeListOfIntRanges(value); - for (unsigned int i=0;iSetStickyBitOn(j); } } } else if (fgkStickyOffName.CompareTo(nm,TString::kIgnoreCase)==0){ - vector< pair > lst = decoder::DecodeListOfIntRanges(value); - for (unsigned int i=0;iSetStickyBitOff(j); } } @@ -270,9 +275,11 @@ void AliMUONSt1Response::SetPairToParam(const string& name,const string& value,A //__________________________________________________________________________ -void AliMUONSt1Response::SetPairToListElem(const string& name,const string& value,TList* list) +void AliMUONSt1Response::SetPairToListElem(const string& name, + const string& value, TList* list) { // set a (name,value) pair to + const char* nm = name.c_str(); if (fgkIJName.CompareTo(nm,TString::kIgnoreCase)==0){ ReadCouplesOfIntRanges(value,list,AliMUONSt1ElectronicElement::kIJ); @@ -281,8 +288,8 @@ void AliMUONSt1Response::SetPairToListElem(const string& name,const string& valu } else if (fgkMGName.CompareTo(nm,TString::kIgnoreCase)==0){ ReadCouplesOfIntRanges(value,list,AliMUONSt1ElectronicElement::kMG); } else if (fgkMName.CompareTo(nm,TString::kIgnoreCase)==0){ - vector< pair > lst = decoder::DecodeListOfIntRanges(value); - for (unsigned int i=0;ith structures + TString path = fgkTopDir + fgkDataDir ; //read .ini file if (gSystem->AccessPathName(path+fIniFileName[plane],kReadPermission)){ @@ -314,14 +322,15 @@ void AliMUONSt1Response::ReadIniFile(Int_t plane) //__________________________________________________________________________ void AliMUONSt1Response::ReadIniFile(Int_t plane,const TString& fileName, - Bool_t rdParam,Bool_t rdRegion,Bool_t rdRule) + Bool_t rdParam,Bool_t rdRegion,Bool_t rdRule) { //Read the given ini file and fill the th structures + cout<<"Reading parameter file "< lst = decoder::SplitList(value,":"); + StringVector lst = decoder::SplitList(value,":"); if (lst.size()>0){ TString inFileName = TString(gSystem->DirName(fileName))+"/" + lst[0].c_str(); Bool_t inParam=kFALSE,inRegion=kFALSE,inRule=kFALSE; if (lst.size()>1) { - vector lst2 = decoder::SplitList(lst[1],","); - for (unsigned int k=0;k > lst = decoder::DecodeListOfIntRanges(value); - for (unsigned int i=0;i0) zones[j-1] = kTRUE; } } } else if (fgkRegionName.CompareTo(name.c_str(),TString::kIgnoreCase)==0){ - TListMap::iterator it = fRegions.find(value); + ListMap::iterator it = fRegions.find(value); if (it != fRegions.end()){ if (!rule) { rule = new AliMUONSt1ResponseRule(); @@ -417,7 +426,7 @@ void AliMUONSt1Response::ReadIniFile(Int_t plane,const TString& fileName, string name = (*itValue).first; string value = (*itValue).second; if (fgkParameterName.CompareTo(name.c_str(),TString::kIgnoreCase)==0){ - TParamsMap::iterator it = fParams.find(value); + ParamsMap::iterator it = fParams.find(value); if (it != fParams.end()){ AliMUONSt1ResponseParameter* param = (*it).second; for (i=0;iGetNofZones();izone++){ AliMpZone* zone = sector->GetZone(izone); for (Int_t isub=0;isubGetNofSubZones();isub++){ @@ -504,8 +516,7 @@ AliMpZone* AliMUONSt1Response::FindZone(AliMpSector* sector,Int_t posId) const //__________________________________________________________________________ - -Int_t AliMUONSt1Response::DigitResponse(Int_t digit,AliMUONTransientDigit* where) +Int_t AliMUONSt1Response::DigitResponse(Int_t digit, AliMUONTransientDigit* where) { // returns the electronic response of pad located at , when // a charge is present @@ -589,6 +600,7 @@ Int_t AliMUONSt1Response::DigitResponse(Int_t digit,AliMUONTransientDigit* wher void AliMUONSt1Response::PrintStatistics() const { // Show the results of the statistics + cout<<"The DigitResponse() method was called "< +#ifndef __HP_aCC + using std::map; +#endif + #include #include + #include "AliMUONResponseV0.h" -#include "AliMUONSt1Types.h" #include "AliMUONSt1ElectronicElement.h" class AliMpPlane; @@ -48,6 +53,10 @@ public: private: + // typedefs + typedef map ParamsMap; + typedef map ListMap; + // operators AliMUONSt1Response& operator=(const AliMUONSt1Response & rhs); @@ -106,9 +115,9 @@ private: Int_t fChamber; // The chamber number - TParamsMap fParams; //! internal parameter list - TListMap fRegions; //! internal list of regions - TList fTrashList; //!internal trash list + ParamsMap fParams; //! internal parameter list + ListMap fRegions; //! internal list of regions + TList fTrashList; //! internal trash list ClassDef(AliMUONSt1Response,1) // Overall detector response }; -- 2.43.0