From: ivana Date: Wed, 18 Jul 2007 14:48:42 +0000 (+0000) Subject: Applying the trigger chamber response to the cluster and not to each pad X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=7d7d22a6669705d3d40dfb1e27f6798e3fdb4862;p=u%2Fmrichter%2FAliRoot.git Applying the trigger chamber response to the cluster and not to each pad of the cluster; moving this from AliMUONDigitizerV3 to AliMUONSDigitizerV2 (Diego) --- diff --git a/MUON/AliMUONDigitizerV3.cxx b/MUON/AliMUONDigitizerV3.cxx index 87d6d50c45f..29edc6a0cd7 100644 --- a/MUON/AliMUONDigitizerV3.cxx +++ b/MUON/AliMUONDigitizerV3.cxx @@ -26,7 +26,6 @@ #include "AliMUONConstants.h" #include "AliMUONDigit.h" #include "AliMUONLogger.h" -#include "AliMUONTriggerEfficiencyCells.h" #include "AliMUONTriggerElectronics.h" #include "AliMUONTriggerStoreV1.h" #include "AliMUONVCalibParam.h" @@ -98,7 +97,6 @@ AliMUONDigitizerV3::AliMUONDigitizerV3(AliRunDigitizer* manager, fIsInitialized(kFALSE), fCalibrationData(0x0), fTriggerProcessor(0x0), -fTriggerEfficiency(0x0), fNoiseFunction(0x0), fNoiseFunctionTrig(0x0), fGenerateNoisyDigits(generateNoisyDigits), @@ -182,63 +180,6 @@ AliMUONDigitizerV3::ApplyResponseToTrackerDigit(AliMUONVDigit& digit, Bool_t add digit.SetADC(adc); } -//_____________________________________________________________________________ -void -AliMUONDigitizerV3::ApplyResponseToTriggerDigit(const AliMUONVDigitStore& digitStore, - AliMUONVDigit& digit) -{ - /// \todo add comment - - if ( !fTriggerEfficiency ) return; - - if (digit.IsEfficiencyApplied()) return; - - AliMUONVDigit* correspondingDigit = FindCorrespondingDigit(digitStore,digit); - - if (!correspondingDigit) return; //reject bad correspondences - - Int_t detElemId = digit.DetElemId(); - - AliMpSegmentation* segmentation = AliMpSegmentation::Instance(); - const AliMpVSegmentation* segment[2] = - { - segmentation->GetMpSegmentation(detElemId,AliMp::GetCathodType(digit.Cathode())), - segmentation->GetMpSegmentation(detElemId,AliMp::GetCathodType(correspondingDigit->Cathode())) - }; - - AliMpPad pad[2] = - { - segment[0]->PadByIndices(AliMpIntPair(digit.PadX(),digit.PadY()),kTRUE), - segment[1]->PadByIndices(AliMpIntPair(correspondingDigit->PadX(),correspondingDigit->PadY()),kTRUE) - }; - - Int_t p0(1); - if (digit.Cathode()==0) p0=0; - - AliMpIntPair location = pad[p0].GetLocation(0); - Int_t nboard = location.GetFirst(); - - Bool_t isTrig[2]; - - fTriggerEfficiency->IsTriggered(detElemId, nboard, - isTrig[0], isTrig[1]); - digit.EfficiencyApplied(kTRUE); - correspondingDigit->EfficiencyApplied(kTRUE); - - if (!isTrig[digit.Cathode()]) - { - digit.SetCharge(0); - } - - if ( &digit != correspondingDigit ) - { - if (!isTrig[correspondingDigit->Cathode()]) - { - correspondingDigit->SetCharge(0); - } - } -} - //_____________________________________________________________________________ void AliMUONDigitizerV3::ApplyResponse(const AliMUONVDigitStore& store, @@ -262,10 +203,7 @@ AliMUONDigitizerV3::ApplyResponse(const AliMUONVDigitStore& store, { ApplyResponseToTrackerDigit(*digit,kAddNoise); } - else - { - ApplyResponseToTriggerDigit(store,*digit); - } + if ( digit->ADC() > 0 || digit->Charge() > 0 ) { filteredStore.Add(*digit,AliMUONVDigitStore::kIgnore); @@ -492,31 +430,6 @@ AliMUONDigitizerV3::Exec(Option_t*) fOutputDigitStore->Clear(); } -//_____________________________________________________________________________ -AliMUONVDigit* -AliMUONDigitizerV3::FindCorrespondingDigit(const AliMUONVDigitStore& digitStore, - AliMUONVDigit& digit) const -{ - /// Find, if it exists, the digit corresponding to digit.Hit(), in the - /// other cathode - - AliCodeTimerAuto("") - - TIter next(digitStore.CreateIterator()); - AliMUONVDigit* d; - - while ( ( d = static_cast(next()) ) ) - { - if ( d->DetElemId() == digit.DetElemId() && - d->Hit() == digit.Hit() && - d->Cathode() != digit.Cathode() ) - { - return d; - } - } - return 0x0; -} - //_____________________________________________________________________________ void @@ -804,20 +717,6 @@ AliMUONDigitizerV3::Init() } fTriggerProcessor = new AliMUONTriggerElectronics(fCalibrationData); - if ( muon()->GetTriggerEffCells() ) - { - fTriggerEfficiency = fCalibrationData->TriggerEfficiency(); - if ( fTriggerEfficiency ) - { - AliDebug(1, "Will apply trigger efficiency"); - } - else - { - AliFatal("I was requested to apply trigger efficiency, but I could " - "not get it !"); - } - } - AliDebug(1, Form("Will %s generate noise-only digits for tracker", (fGenerateNoisyDigits ? "":"NOT"))); diff --git a/MUON/AliMUONDigitizerV3.h b/MUON/AliMUONDigitizerV3.h index e63929716a8..73577aec5e6 100644 --- a/MUON/AliMUONDigitizerV3.h +++ b/MUON/AliMUONDigitizerV3.h @@ -19,7 +19,6 @@ class AliMUONCalibrationData; class AliMUONVDigit; class AliMUONLogger; -class AliMUONTriggerEfficiencyCells; class TClonesArray; class TF1; class TString; @@ -55,15 +54,11 @@ private: void ApplyResponse(const AliMUONVDigitStore& store, AliMUONVDigitStore& filteredStore); void ApplyResponseToTrackerDigit(AliMUONVDigit& digit, Bool_t addNoise); - void ApplyResponseToTriggerDigit(const AliMUONVDigitStore& digitStore, AliMUONVDigit& digit); AliLoader* GetLoader(const TString& foldername); private: - AliMUONVDigit* FindCorrespondingDigit(const AliMUONVDigitStore& digitStore, - AliMUONVDigit& digit) const; - void GenerateNoisyDigits(AliMUONVDigitStore& digitStore); void GenerateNoisyDigitsForOneCathode(AliMUONVDigitStore& digitStore, Int_t detElemId, Int_t cathode); @@ -77,7 +72,6 @@ private: Bool_t fIsInitialized; ///< are we initialized ? AliMUONCalibrationData* fCalibrationData; //!< pointer to access calib parameters AliMUONTriggerElectronics* fTriggerProcessor; ///< pointer to the trigger part of the job - AliMUONTriggerEfficiencyCells* fTriggerEfficiency; ///< trigger efficiency map TF1* fNoiseFunction; //!< function to randomly get signal above n*sigma_ped TF1* fNoiseFunctionTrig; //!< function to get noise disribution on trig. chambers Int_t fGenerateNoisyDigits; //!< whether or not we should generate noise-only digits for tracker (1) and trigger (2) diff --git a/MUON/AliMUONResponseTrigger.cxx b/MUON/AliMUONResponseTrigger.cxx index fd1f23833c7..c46d286ac26 100644 --- a/MUON/AliMUONResponseTrigger.cxx +++ b/MUON/AliMUONResponseTrigger.cxx @@ -30,6 +30,7 @@ #include "AliMUONGeometryTransformer.h" #include "AliMUONHit.h" #include "AliMUONConstants.h" +#include "AliMUONTriggerEfficiencyCells.h" #include "AliMpPad.h" #include "AliMpCathodType.h" @@ -68,7 +69,8 @@ namespace //------------------------------------------------------------------ AliMUONResponseTrigger::AliMUONResponseTrigger() - : AliMUONResponse() + : AliMUONResponse(), + fTriggerEfficiency(0x0) { /// Default constructor } @@ -102,7 +104,9 @@ AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits) { twentyNano=1; } - + + Bool_t isTrig[2]={kTRUE,kTRUE}; + for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath ) { const AliMpVSegmentation* seg @@ -131,12 +135,36 @@ AliMUONResponseTrigger::DisIntegrate(const AliMUONHit& hit, TList& digits) //FIXME : a trigger digit can have several locations. //this is not currently supported by the digit class. Change that or not ? d->SetCharge(twentyNano); + + if(fTriggerEfficiency){ + if(cath==0){ + Int_t nboard = pad.GetLocation(0).GetFirst(); + fTriggerEfficiency->IsTriggered(detElemId, nboard, + isTrig[0], isTrig[1]); + } + if(!isTrig[cath]) continue; + } + digits.Add(d); } } +//_____________________________________________________________________________ +void +AliMUONResponseTrigger::InitTriggerEfficiency(AliMUONTriggerEfficiencyCells *triggerEfficiency) +{ +/// Initialize trigger chamber efficiency (on demand) - - + fTriggerEfficiency = triggerEfficiency; + if ( fTriggerEfficiency ) + { + AliDebug(1, "Will apply trigger efficiency"); + } + else + { + AliFatal("I was requested to apply trigger efficiency, but I could " + "not get it !"); + } +} diff --git a/MUON/AliMUONResponseTrigger.h b/MUON/AliMUONResponseTrigger.h index 6a582800d62..19fe606036c 100644 --- a/MUON/AliMUONResponseTrigger.h +++ b/MUON/AliMUONResponseTrigger.h @@ -11,6 +11,7 @@ /// \brief Implementation of RPC response #include "AliMUONResponse.h" +#include "AliMUONTriggerEfficiencyCells.h" class AliMUONResponseTrigger : public AliMUONResponse { @@ -22,23 +23,20 @@ class AliMUONResponseTrigger : public AliMUONResponse virtual Int_t SetGenerCluster(){return 0;} virtual void DisIntegrate(const AliMUONHit& hit, TList& digits); + + virtual void InitTriggerEfficiency(AliMUONTriggerEfficiencyCells* triggerEfficiency); + + protected: + AliMUONTriggerEfficiencyCells* fTriggerEfficiency; //!< trigger efficiency map private: + /// Not implemented + AliMUONResponseTrigger(const AliMUONResponseTrigger& other); + /// Not implemented + AliMUONResponseTrigger& operator=(const AliMUONResponseTrigger& other); // assignment operator + - ClassDef(AliMUONResponseTrigger,1) // Implementation of RPC response + ClassDef(AliMUONResponseTrigger,2) // Implementation of RPC response }; #endif - - - - - - - - - - - - - diff --git a/MUON/AliMUONResponseTriggerV1.cxx b/MUON/AliMUONResponseTriggerV1.cxx index 0a20726ba75..4d8070ec7cb 100644 --- a/MUON/AliMUONResponseTriggerV1.cxx +++ b/MUON/AliMUONResponseTriggerV1.cxx @@ -149,6 +149,8 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits twentyNano=1; } + Bool_t isTrig[2]={kTRUE, kTRUE}; + for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath ) { const AliMpVSegmentation* seg @@ -165,6 +167,16 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits d->SetPadXY(ix,iy); d->SetCharge(twentyNano); + + if(fTriggerEfficiency){ + if(cath==0){ + Int_t nboard = pad.GetLocation(0).GetFirst(); + fTriggerEfficiency->IsTriggered(detElemId, nboard, + isTrig[0], isTrig[1]); + } + if(!isTrig[cath]) continue; + } + digits.Add(d); SetGenerCluster(); // 1 randum number per cathode (to be checked) diff --git a/MUON/AliMUONSDigitizerV2.cxx b/MUON/AliMUONSDigitizerV2.cxx index a7a589f3065..4a61a4dc16b 100644 --- a/MUON/AliMUONSDigitizerV2.cxx +++ b/MUON/AliMUONSDigitizerV2.cxx @@ -32,6 +32,10 @@ #include "AliMUONVDigitStore.h" #include "AliMUONVHitStore.h" +#include "AliCDBManager.h" +#include "AliMUONCalibrationData.h" +#include "AliMUONResponseTrigger.h" + //----------------------------------------------------------------------------- /// The sdigitizer performs the transformation from hits (energy deposits by /// the transport code) to sdigits (equivalent of charges on pad). @@ -92,7 +96,17 @@ AliMUONSDigitizerV2::Exec(Option_t*) loader->LoadHits("READ"); AliMUON* muon = static_cast(gAlice->GetModule("MUON")); - + + AliMUONCalibrationData *calibrationData = 0x0; + + if(muon->GetTriggerEffCells()){ + Int_t runnumber = AliCDBManager::Instance()->GetRun(); + calibrationData = new AliMUONCalibrationData(runnumber); + for (Int_t chamber = 10; chamber < 14; chamber++) { + ((AliMUONResponseTrigger *) (muon->Chamber(chamber).ResponseModel()))->InitTriggerEfficiency(calibrationData->TriggerEfficiency()); // Init trigger efficiency + } + } + Int_t nofEvents(runLoader->GetNumberOfEvents()); TString classname = muon->DigitStoreClassName(); @@ -198,4 +212,6 @@ AliMUONSDigitizerV2::Exec(Option_t*) loader->UnloadHits(); delete sDigitStore; + + if(calibrationData) delete calibrationData; }