- if (!tree){
- loader->MakeTree("S");
- tree = loader->TreeS();
- }
- //
- // Array for SDigits
- //
- TClonesArray aSDigits("AliITSpListItem",10000), *itsSDigits=&aSDigits;
- Int_t bufsize = 32000;
- tree->Branch("ITS", &itsSDigits, bufsize);
- Int_t npx = 0;
- //
- // SPD
- //
- AliITSsegmentationSPD* segSPD = (AliITSsegmentationSPD*) fDetTypeSim->GetSegmentationModel(0);
- if(!segSPD){
- AliWarning("Set AliITS defaults");
- SetDefaults();
- segSPD = (AliITSsegmentationSPD*) fDetTypeSim->GetSegmentationModel(0);
+ }
+ //
+ // Array for SDigits
+ //
+ if(!fpSDigits){
+ fpSDigits = new TClonesArray("AliITSpListItem",10000);
+ }
+ TClonesArray& aSDigits = *fpSDigits;
+ Int_t bufsize = 32000;
+ tree->Branch("ITS", &fpSDigits, bufsize);
+ Int_t npx = 0;
+ //
+ // SPD
+ //
+ AliITSsegmentationSPD* segSPD = (AliITSsegmentationSPD*) fDetTypeSim->GetSegmentationModel(0);
+ if(!segSPD){
+ AliWarning("Set AliITS defaults");
+ SetDefaults();
+ segSPD = (AliITSsegmentationSPD*) fDetTypeSim->GetSegmentationModel(0);
+ }
+ npx = segSPD->Npx();
+ Double_t thr, sigma;
+
+ Int_t countRW = -1; // RS counter for raw -> cluster ID's (used in embedding)
+ const TArrayI* rawID2clusID = fkRawID2ClusID[kSPD];
+ AliITSRawStreamSPD inputSPD(rawReader);
+ while(1){
+ Bool_t next = inputSPD.Next();
+ if (!next) break;
+
+ countRW++; // RS
+ Int_t module = inputSPD.GetModuleID();
+ Int_t column = inputSPD.GetColumn();
+ Int_t row = inputSPD.GetRow();
+ Int_t index = npx * column + row;
+
+ if (module >= size) continue;
+
+ last = (fModA[module])->GetEntries();
+ TClonesArray& dum = *fModA[module];
+ fDetTypeSim->GetSimuParam()->SPDThresholds(module,thr,sigma);
+ thr += 1.;
+ int label = kMaxLabel;
+ if (rawID2clusID) { // RS If the raw->cluster ID is set (filled by cluster finder) store cluster ID's in SDigits
+ if (rawID2clusID->GetSize()<=countRW) {AliError(Form("The buffer of rawSPD to clusSPD ID's is shorter than current rawSPD ID=%d",countRW));}
+ else label = (*rawID2clusID)[countRW];