#include "CbmTrdParSetDigi.h" #include "CbmTrdParModDigi.h" #include #include #include #include CbmTrdParSetDigi::CbmTrdParSetDigi(const char* name, const char* title, const char* context) : CbmTrdParSet(name, title, context) { } //_______________________________________________________________________________ Bool_t CbmTrdParSetDigi::getParams(FairParamList* l) { if (!l) return kFALSE; if ( ! l->fill("NrOfModules", &fNrOfModules) ){ LOG(error)<fill("MaxSectors", &maxSectors) ){ LOG(error)<fill("ModuleIdArray", &moduleId) ){ LOG(error)<fill(Form("%d", moduleId[i]), &values) ) { LOG(error)<SetModuleId(moduleId[i]); ((CbmTrdParModDigi*)fModuleMap[moduleId[i]])->SetAnodeWireToPadPlaneDistance(awPP);//>0?awPP:0.35); ((CbmTrdParModDigi*)fModuleMap[moduleId[i]])->SetAnodeWireOffset(awOff);//>0?awOff:0.375); ((CbmTrdParModDigi*)fModuleMap[moduleId[i]])->SetAnodeWireSpacing(awPitch);//>0?awPitch:0.25); if ( FairLogger::GetLogger()->IsLogNeeded(fair::Severity::debug) ) fModuleMap[moduleId[i]]->Print(); } return kTRUE; } //_____________________________________________________________________ void CbmTrdParSetDigi::putParams(FairParamList* l) { /** Instead of a fixed number of values the number of values to store now depends on the maximum number of sectors per module The first eleven parameters are for the complete module. The parametrs are: orientation : module rotation in 90deg fAnodeWireSpacing : width of amplification cell in cm fAnodeWireToPadPlaneDistance : anode 2 pad plane distance in cm fAnodeWireOffset : offset of first anode wire wrt pad plane X, Y, Z : position of the middle of the gaslayer. SizeX, SizeY, SizeZ : size of the gaslayer. The values are only the half size which are the values returned by geant. The rest of the parameters depend on the number of sectors. SectorSizeX(Y) : size of a sector PadSizeX(Y) : size of the pads in this sector */ if (!l) return; LOG(info)<::iterator imod=fModuleMap.begin(); imod!=fModuleMap.end(); imod++){ moduleIdArray[idx++]=imod->first; Int_t sectors = ((CbmTrdParModDigi*)imod->second)->GetNofSectors(); if(sectors>maxSectors) maxSectors = sectors; } l->add("NrOfModules", fNrOfModules); l->add("MaxSectors", maxSectors); l->add("ModuleIdArray", moduleIdArray); Int_t nrValues = 10 + ( maxSectors * 4 ); TArrayD values(nrValues); CbmTrdParModDigi *mod(NULL); for (Int_t i=0; i < fNrOfModules; i++){ Int_t k(0); mod = (CbmTrdParModDigi*)fModuleMap[moduleIdArray[i]]; values.AddAt(mod->GetOrientation(), k++); // Int_t roType(0); // if(mod->GetPadGeoTriangular()) roType |= 1; // if(mod->GetAsicFASP()) roType |= 2; // values.AddAt(roType, k++); values.AddAt(mod->GetAnodeWireSpacing(),k++); values.AddAt(mod->GetAnodeWireToPadPlaneDistance(),k++); values.AddAt(mod->GetAnodeWireOffset(),k++); values.AddAt(mod->GetX(),k++); values.AddAt(mod->GetY(),k++); values.AddAt(mod->GetZ(),k++); values.AddAt(mod->GetSizeX(),k++); values.AddAt(mod->GetSizeY(),k++); values.AddAt(mod->GetSizeZ(),k++); for (Int_t j=0; j < maxSectors; j++){ values.AddAt(mod->GetSectorSizeX(j),k++); values.AddAt(mod->GetSectorSizeY(j),k++); values.AddAt(mod->GetPadSizeX(j),k++); values.AddAt(mod->GetPadSizeY(j),k++); } TString text; text += moduleIdArray[i]; l->add(text.Data(), values); } } ClassImp(CbmTrdParSetDigi)