#include "AliMUONSDigitizerV2.h"
-#include "AliLog.h"
#include "AliMUON.h"
#include "AliMUONChamber.h"
#include "AliMUONVDigit.h"
#include "AliMUONHit.h"
-#include "AliMpDEManager.h"
+#include "AliMUONVDigitStore.h"
+#include "AliMUONVHitStore.h"
+#include "AliMUONCalibrationData.h"
+#include "AliMUONResponseTrigger.h"
+
#include "AliMpCDB.h"
+#include "AliMpDEManager.h"
+
+#include "AliLog.h"
+#include "AliCDBManager.h"
#include "AliLoader.h"
#include "AliRun.h"
#include "AliRunLoader.h"
-#include "AliMUONVDigitStore.h"
-#include "AliMUONVHitStore.h"
//-----------------------------------------------------------------------------
/// The sdigitizer performs the transformation from hits (energy deposits by
///
/// ctor.
///
- if ( ! AliMpCDB::LoadMpSegmentation() )
- {
+
+ // Load mapping
+ if ( ! AliMpCDB::LoadMpSegmentation() ) {
AliFatal("Could not access mapping from OCDB !");
}
}
AliDebug(1,"");
- AliRunLoader* runLoader = AliRunLoader::GetRunLoader();
+ AliRunLoader* runLoader = AliRunLoader::Instance();
AliLoader* loader = runLoader->GetDetectorLoader("MUON");
loader->LoadHits("READ");
AliMUON* muon = static_cast<AliMUON*>(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();
AliFatal(Form("Could not create digitstore of class %s",classname.Data()));
}
- AliInfo(Form("Will use digitStore of type %s",sDigitStore->ClassName()));
+ AliDebug(1,Form("Will use digitStore of type %s",sDigitStore->ClassName()));
for ( Int_t iEvent = 0; iEvent < nofEvents; ++iEvent )
{
TList digits;
response->DisIntegrate(*hit,digits);
- TIter next(&digits);
+ TIter nextd(&digits);
AliMUONVDigit* d;
- while ( ( d = (AliMUONVDigit*)next() ) )
+ while ( ( d = (AliMUONVDigit*)nextd() ) )
{
// Update some sdigit information that could not be known
// by the DisIntegrate method
d->SetHit(ihit);
- d->AddTrack(iTrack,d->Charge());
+ d->AddTrack(hit->GetTrack(),d->Charge());
tdlist.Add(d);
}
++ihit;
loader->UnloadHits();
delete sDigitStore;
+
+ if(calibrationData) delete calibrationData;
}