X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITS.cxx;h=3485d1fd44a76e89325122e31fdc2aee76990241;hb=67abca5cc566a83973de95c2cb734b906f9e2e86;hp=3e096c057028e44eed9c120be1cca0cd628a0e85;hpb=679379e8a03552a0cd56e106e3694860f581c46c;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITS.cxx b/ITS/AliITS.cxx index 3e096c05702..3485d1fd44a 100644 --- a/ITS/AliITS.cxx +++ b/ITS/AliITS.cxx @@ -72,6 +72,7 @@ the AliITS class. #include #include #include +#include #include "AliDetector.h" #include "AliITS.h" #include "AliITSDetTypeSim.h" @@ -125,6 +126,7 @@ fpSDigits(0) // SetDetectors(); // default to fOpt="All". This variable not written out. //PH SetMarkerColor(kRed); + for (int i=fgkNTYPES;i--;) fkRawID2ClusID[i] = 0; } //______________________________________________________________________ AliITS::AliITS(const Char_t *title): @@ -165,6 +167,7 @@ AliITS::AliITS(const Char_t *title): //PH SetMarkerColor(kRed); if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName()); fDetTypeSim->SetLoader((AliITSLoader*)fLoader); + for (int i=fgkNTYPES;i--;) fkRawID2ClusID[i] = 0; } //______________________________________________________________________ AliITS::AliITS(const char *name, const char *title): @@ -201,7 +204,7 @@ AliITS::AliITS(const char *name, const char *title): //PH SetMarkerColor(kRed); if(!fLoader) MakeLoader(AliConfig::GetDefaultEventFolderName()); fDetTypeSim->SetLoader((AliITSLoader*)fLoader); - + for (int i=fgkNTYPES;i--;) fkRawID2ClusID[i] = 0; } //______________________________________________________________________ AliITS::~AliITS(){ @@ -254,18 +257,18 @@ AliITS::~AliITS(){ } //______________________________________________________________________ -AliDigitizer* AliITS::CreateDigitizer(AliRunDigitizer* manager)const{ +AliDigitizer* AliITS::CreateDigitizer(AliDigitizationInput* digInput)const{ // Creates the AliITSDigitizer in a standard way for use via AliModule. // This function can not be included in the .h file because of problems // with the order of inclusion (recursive). // Inputs: - // AliRunDigitizer *manager The Manger class for Digitization + // AliDigitizationInput* digInput The Manger class for Digitization // Output: // none. // Return: // A new AliITSRunDigitizer (cast as a AliDigitizer). - return new AliITSDigitizer(manager); + return new AliITSDigitizer(digInput); } //______________________________________________________________________ void AliITS::Init(){ @@ -748,16 +751,10 @@ void AliITS::HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, ClearModules(); - // Add random noise to FO signals - if (all || det[0]) { // SPD present - fDetTypeSim->ProcessNoiseForFastOr(); - } - // Add Fast-OR signals to event (only one object per event) if (all || det[0]) { // SPD present - fDetTypeSim->WriteFOSignals(); + WriteFOSignals(); } - fLoader->TreeD()->GetEntries(); fLoader->TreeD()->AutoSave(); @@ -1010,7 +1007,6 @@ void AliITS::SDigitsToDigits(Option_t *opt){ AliError("fDetTypeSim is 0!"); return; } - const char *all = strstr(opt,"All"); const char *det[3] ={strstr(opt,"SPD"),strstr(opt,"SDD"), strstr(opt,"SSD")}; @@ -1023,13 +1019,9 @@ void AliITS::SDigitsToDigits(Option_t *opt){ if(fSimuParam) fDetTypeSim->SetSimuParam(fSimuParam); fDetTypeSim->SDigitsToDigits(opt,(Char_t*)GetName()); - // Add random noise to FO signals - if (all || det[0]) { // SPD present - fDetTypeSim->ProcessNoiseForFastOr(); - } // Add Fast-OR signals to event (only one object per event) if (all || det[0]) { // SPD present - fDetTypeSim->WriteFOSignals(); + WriteFOSignals(); } } @@ -1257,12 +1249,15 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) } 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(); @@ -1274,7 +1269,12 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) TClonesArray& dum = *fModA[module]; fDetTypeSim->GetSimuParam()->SPDThresholds(module,thr,sigma); thr += 1.; - new (dum[last]) AliITSpListItem(-1, -1, module, index, thr); + 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]; + } + new (dum[last]) AliITSpListItem(label, -1, module, index, thr); } rawReader->Reset(); @@ -1286,7 +1286,9 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) Int_t scalef=AliITSsimulationSDD::ScaleFourier(segSDD); Int_t firstSDD=AliITSgeomTGeo::GetModuleIndex(3,1,1); Int_t firstSSD=AliITSgeomTGeo::GetModuleIndex(5,1,1); - + // + countRW = -1; // RS + rawID2clusID = fkRawID2ClusID[kSDD]; AliITSRawStream* inputSDD=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader); for(Int_t iMod=firstSDD; iModGetCalibrationModel(iMod); @@ -1301,6 +1303,7 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) AliITSDDLModuleMapSDD* ddlmap=fDetTypeSim->GetDDLModuleMapSDD(); inputSDD->SetDDLModuleMap(ddlmap); while(inputSDD->Next()){ + countRW++; // RS if(inputSDD->IsCompletedModule()==kFALSE && inputSDD->IsCompletedDDL()==kFALSE){ @@ -1313,7 +1316,12 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) if (module >= size) continue; last = fModA[module]->GetEntries(); TClonesArray& dum = *fModA[module]; - new (dum[last]) AliITSpListItem(-1, -1, module, index, Double_t(signal10)); + 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 rawSDD to clusSDD ID's is shorter than current rawSDD ID=%d",countRW));} + else label = (*rawID2clusID)[countRW]; + } + new (dum[last]) AliITSpListItem(label, -1, module, index, Double_t(signal10)); ((AliITSpListItem*) dum.At(last))->AddSignalAfterElect(module, index, Double_t(signal10)); } } @@ -1326,10 +1334,12 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) AliITSsegmentationSSD* segSSD = (AliITSsegmentationSSD*) fDetTypeSim->GetSegmentationModel(2); npx = segSSD->Npx(); AliITSRawStreamSSD inputSSD(rawReader); + countRW = -1; + rawID2clusID = fkRawID2ClusID[kSSD]; while(1){ Bool_t next = inputSSD.Next(); if (!next) break; - + countRW++; // RS Int_t module = inputSSD.GetModuleID(); if(module<0)AliError(Form("Invalid SSD module %d \n",module)); if(module<0)continue; @@ -1342,7 +1352,12 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) last = fModA[module]->GetEntries(); TClonesArray& dum = *fModA[module]; - new (dum[last]) AliITSpListItem(-1, -1, module, index, Double_t(signal)); + 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 rawSSD to clusSSD ID's is shorter than current rawSSD ID=%d",countRW));} + else label = (*rawID2clusID)[countRW]; + } + new (dum[last]) AliITSpListItem(label, -1, module, index, Double_t(signal)); } rawReader->Reset(); AliITSpListItem* sdig = 0; @@ -1360,7 +1375,7 @@ Bool_t AliITS::Raw2SDigits(AliRawReader* rawReader) sdig = (AliITSpListItem*) (fModA[mod]->At(ie)); Double_t digsig = sdig->GetSignal(); if(mod>=firstssd) digsig*=adcToEv; // for SSD: convert back charge from ADC to electron - new (aSDigits[ie]) AliITSpListItem(-1, -1, mod, sdig->GetIndex(), digsig); + new (aSDigits[ie]) AliITSpListItem(sdig->GetTrack(0), -1, mod, sdig->GetIndex(), digsig); Float_t sig = sdig->GetSignalAfterElect(); if(mod>=firstssd) sig*=adcToEv; if (sig > 0.) { @@ -1393,3 +1408,13 @@ AliTriggerDetector* AliITS::CreateTriggerDetector() const { // create an AliITSTrigger object (and set trigger conditions as input) return new AliITSTrigger(fDetTypeSim->GetTriggerConditions()); } +//______________________________________________________________________ +void AliITS::WriteFOSignals(){ +// This method write FO signals in Digits tree both in Hits2Digits +// or SDigits2Digits + + fDetTypeSim->ProcessNoiseForFastOr(); + fDetTypeSim->WriteFOSignals(); +} + +