const Int_t AliITSDetTypeSim::fgkDefaultNModulesSDD = 260;
const Int_t AliITSDetTypeSim::fgkDefaultNModulesSSD = 1698;
+using std::endl;
+using std::cout;
ClassImp(AliITSDetTypeSim)
//----------------------------------------------------------------------
fCalibration(), // [NMod]
fSSDCalibration(0),
fSPDNoisy(0),
+fSPDSparseDead(0),
fNSDigits(0), //! number of SDigits
fSDigits("AliITSpListItem",1000),
fNDigits(0), //! number of Digits
fDDLMapSDD=new AliITSDDLModuleMapSDD();
fSimuPar= new AliITSSimuParam();
fSSDCalibration=new AliITSCalibrationSSD();
- fNMod[0] = fgkDefaultNModulesSPD;
- fNMod[1] = fgkDefaultNModulesSDD;
- fNMod[2] = fgkDefaultNModulesSSD;
SetRunNumber();
}
//----------------------------------------------------------------------
fSPDNoisy = 0;
}
}
+ if(fSPDSparseDead){
+ if(!(AliCDBManager::Instance()->GetCacheFlag())) {
+ fSPDSparseDead->Delete();
+ delete fSPDSparseDead;
+ fSPDSparseDead = 0;
+ }
+ }
if(fSimuPar) delete fSimuPar;
if(fRespSDD){
if(!(AliCDBManager::Instance()->GetCacheFlag())){
fDigits=0;
}
//----------------------------------------------------------------------
-AliITSDetTypeSim::AliITSDetTypeSim(const AliITSDetTypeSim &source) : TObject(source),
-fSimulation(source.fSimulation), // [NDet]
-fSegmentation(source.fSegmentation), // [NDet]
-fCalibration(source.fCalibration), // [NMod]
-fSSDCalibration(source.fSSDCalibration),
-fSPDNoisy(source.fSPDNoisy),
-fNSDigits(source.fNSDigits), //! number of SDigits
-fSDigits(*((TClonesArray*)source.fSDigits.Clone())),
-fNDigits(source.fNDigits), //! number of Digits
-fRunNumber(source.fRunNumber), //! Run number (to access DB)
-fDigits(source.fDigits), //! [NMod][NDigits]
-fSimuPar(source.fSimuPar),
-fDDLMapSDD(source.fDDLMapSDD),
-fRespSDD(source.fRespSDD),
-fAveGainSDD(source.fAveGainSDD),
-fkDigClassName(), // String with digit class name.
-fLoader(source.fLoader), // local pointer to loader
-fFirstcall(source.fFirstcall),
-fFOGenerator(source.fFOGenerator),
-fTriggerConditions(source.fTriggerConditions)
-{
- // Copy Constructor for object AliITSDetTypeSim not allowed
- for(Int_t i=0;i<fgkNdettypes;i++){
- fkDigClassName[i] = source.fkDigClassName[i];
- }
-}
-//----------------------------------------------------------------------
-AliITSDetTypeSim& AliITSDetTypeSim::operator=(const AliITSDetTypeSim &source){
- // The = operator for object AliITSDetTypeSim
+// AliITSDetTypeSim::AliITSDetTypeSim(const AliITSDetTypeSim &source) : TObject(source),
+// fSimulation(source.fSimulation), // [NDet]
+// fSegmentation(source.fSegmentation), // [NDet]
+// fCalibration(source.fCalibration), // [NMod]
+// fSSDCalibration(source.fSSDCalibration),
+// fSPDNoisy(source.fSPDNoisy),
+// fSPDSparseDead(source.fSPDSparseDead),
+// fNSDigits(source.fNSDigits), //! number of SDigits
+// fSDigits(*((TClonesArray*)source.fSDigits.Clone())),
+// fNDigits(source.fNDigits), //! number of Digits
+// fRunNumber(source.fRunNumber), //! Run number (to access DB)
+// fDigits(source.fDigits), //! [NMod][NDigits]
+// fSimuPar(source.fSimuPar),
+// fDDLMapSDD(source.fDDLMapSDD),
+// fRespSDD(source.fRespSDD),
+// fAveGainSDD(source.fAveGainSDD),
+// fkDigClassName(), // String with digit class name.
+// fLoader(source.fLoader), // local pointer to loader
+// fFirstcall(source.fFirstcall),
+// fFOGenerator(source.fFOGenerator),
+// fTriggerConditions(source.fTriggerConditions)
+// {
+// // Copy Constructor for object AliITSDetTypeSim not allowed
+// for(Int_t i=0;i<fgkNdettypes;i++){
+// fkDigClassName[i] = source.fkDigClassName[i];
+// }
+// }
+// //----------------------------------------------------------------------
+// AliITSDetTypeSim& AliITSDetTypeSim::operator=(const AliITSDetTypeSim &source){
+// // The = operator for object AliITSDetTypeSim
- this->~AliITSDetTypeSim();
- new(this) AliITSDetTypeSim(source);
- return *this;
-}
+// this->~AliITSDetTypeSim();
+// new(this) AliITSDetTypeSim(source);
+// return *this;
+// }
//______________________________________________________________________
void AliITSDetTypeSim::SetITSgeom(AliITSgeom *geom){
delete (AliITSCalibration*) fSPDNoisy->At(iMod);
fSPDNoisy->AddAt(cal,iMod);
}
+//_______________________________________________________________________
+void AliITSDetTypeSim::SetSPDSparseDeadModel(Int_t iMod, AliITSCalibration *cal){
+ //Set sparse dead pixel info for the SPD module iMod
+ if (fSPDSparseDead==0) {
+ fSPDSparseDead = new TObjArray(fgkDefaultNModulesSPD);
+ fSPDSparseDead->SetOwner(kTRUE);
+ fSPDSparseDead->Clear();
+ }
+
+ if (fSPDNoisy->At(iMod) != 0)
+ delete (AliITSCalibration*) fSPDNoisy->At(iMod);
+ fSPDNoisy->AddAt(cal,iMod);
+}
//______________________________________________________________________
void AliITSDetTypeSim::ResetCalibrationArray(){
//resets response array
}
- fNMod[0] = calDeadSPD->GetEntries();
- fNMod[1] = calSDD->GetEntries();
- // fNMod[2] = noiseSSD->GetEntries();
+ Int_t nmods0 = calDeadSPD->GetEntries();
+ Int_t nmods1 = calSDD->GetEntries();
+
AliDebug(1,Form("%i SPD, %i SDD and %i SSD in calibration database",
- fNMod[0], fNMod[1], fNMod[2]));
+ nmods0,nmods1,fgkDefaultNModulesSSD));
AliITSCalibration* cal;
- for (Int_t i=0; i<fNMod[0]; i++) {
+ for (Int_t i=0; i<nmods0; i++) {
cal = (AliITSCalibration*) calDeadSPD->At(i);
SetCalibrationModel(i, cal);
cal = (AliITSCalibration*) calNoisySPD->At(i);
//___________________________________________________________________
void AliITSDetTypeSim::SetTreeAddressS(TTree* treeS, const Char_t* name){
// Set branch address for the ITS summable digits Trees.
- char branchname[30];
if(!treeS){
return;
}
TBranch *branch;
- sprintf(branchname,"%s",name);
- branch = treeS->GetBranch(branchname);
+ branch = treeS->GetBranch(name);
TClonesArray *sdigi = &fSDigits;
if (branch) branch->SetAddress(&sdigi);
const char *det[3] = {"SPD","SDD","SSD"};
TBranch *branch;
- char branchname[30];
+ TString branchname;
if(!treeD){
return;
ResetDigits(i);
}
- if(fgkNdettypes==3) sprintf(branchname,"%sDigits%s",name,det[i]);
- else sprintf(branchname,"%sDigits%d",name,i+1);
- if(fDigits){
- branch = treeD->GetBranch(branchname);
- if(branch) branch->SetAddress(&((*fDigits)[i]));
- }
+ if(fgkNdettypes==3) branchname.Form("%sDigits%s",name,det[i]);
+ else branchname.Form("%sDigits%d",name,i+1);
+ branch = treeD->GetBranch(branchname.Data());
+ if(branch) branch->SetAddress(&((*fDigits)[i]));
}
-
}
//___________________________________________________________________
void AliITSDetTypeSim::ResetDigits(){
const char *all = strstr(opt,"All");
const char *det[3] = {strstr(opt,"SPD"),strstr(opt,"SDD"),
strstr(opt,"SSD")};
- if( !det[0] && !det[1] && !det[2] ) all = "All";
- else all = 0;
+ if(!all && !det[0] && !det[1] && !det[2] ) all = "All";
+
static Bool_t setDef = kTRUE;
if(setDef) SetDefaultSimulation();
setDef = kFALSE;
Error("SDigits2Digits","Error: No trees or SDigits. Returning.");
return;
}
- sprintf(name,"%s",name);
+
TBranch* brchSDigits = trees->GetBranch(name);
Int_t id;
fLoader->TreeD()->Fill();
ResetDigits();
}
+
+ WriteFOSignals();
fLoader->TreeD()->GetEntries();
fLoader->TreeD()->AutoSave();
fLoader->TreeD()->Reset();
TTree *tree = fLoader->TreeD();
AliITSFOSignalsSPD *foSignals = new AliITSFOSignalsSPD(*GetFOSignals());
tree->GetUserInfo()->Add(foSignals);
+ fFOGenerator.ResetSignals();
}