#include "AliMpConstants.h"
#include "AliMpDEIterator.h"
#include "AliMpDEManager.h"
-#include "AliMpIntPair.h"
#include "AliMpPad.h"
#include "AliMpStationType.h"
#include "AliMpVSegmentation.h"
fLogger(new AliMUONLogger(1000)),
fTriggerStore(new AliMUONTriggerStoreV1),
fDigitStore(0x0),
-fOutputDigitStore(0x0)
+fOutputDigitStore(0x0),
+fInputDigitStore(0x0)
{
/// Ctor.
delete fTriggerStore;
delete fDigitStore;
delete fOutputDigitStore;
-
+ delete fInputDigitStore;
+
AliInfo("Summary of messages");
fLogger->Print();
return;
}
+ Int_t manuChannel = digit.ManuChannel();
+
+ if ( pedestal->ValueAsFloat(manuChannel,0) == AliMUONVCalibParam::InvalidFloatValue() ||
+ pedestal->ValueAsFloat(manuChannel,1) == AliMUONVCalibParam::InvalidFloatValue() )
+ {
+ // protection against invalid pedestal value
+ digit.SetADC(0);
+ return;
+ }
+
AliMUONVCalibParam* gain = fCalibrationData->Gains(detElemId,manuId);
if (!gain)
{
return;
}
- Int_t manuChannel = digit.ManuChannel();
-
Int_t adc = DecalibrateTrackerDigit(*pedestal,*gain,manuChannel,charge,addNoise,
digit.IsNoiseOnly());
return adc;
}
+//_____________________________________________________________________________
+void
+AliMUONDigitizerV3::CreateInputDigitStore()
+{
+ /// Create an input digit store, and check that all input files
+ /// actually contains the same type of AliMUONVDigitStore
+
+ fInputDigitStore = 0x0;
+
+ for ( Int_t iFile = 0; iFile < fManager->GetNinputs(); ++iFile )
+ {
+ AliLoader* inputLoader = GetLoader(fManager->GetInputFolderName(iFile));
+
+ inputLoader->LoadSDigits("READ");
+
+ TTree* iTreeS = inputLoader->TreeS();
+ if (!iTreeS)
+ {
+ AliFatal(Form("Could not get access to input file #%d",iFile));
+ }
+
+ AliMUONVDigitStore* inputStore = AliMUONVDigitStore::Create(*iTreeS);
+
+ if (!fInputDigitStore)
+ {
+ fInputDigitStore = inputStore;
+ }
+ else
+ {
+ if ( inputStore->IsA() != fInputDigitStore->IsA() )
+ {
+ AliFatal("Got different types of AliMUONVDigitStore here. Please implement me.");
+ }
+ }
+ }
+}
+
//_____________________________________________________________________________
void
AliMUONDigitizerV3::Exec(Option_t*)
{
AliFatal(Form("Could not get access to input file #%d",iFile));
}
-
- AliMUONVDigitStore* inputStore = AliMUONVDigitStore::Create(*iTreeS);
- inputStore->Connect(*iTreeS);
+
+ if (!fInputDigitStore)
+ {
+ CreateInputDigitStore();
+ }
+ fInputDigitStore->Connect(*iTreeS);
iTreeS->GetEvent(0);
- MergeWithSDigits(fDigitStore,*inputStore,fManager->GetMask(iFile));
+ MergeWithSDigits(fDigitStore,*fInputDigitStore,fManager->GetMask(iFile));
inputLoader->UnloadSDigits();
- delete inputStore;
+ fInputDigitStore->Clear();
}
// At this point, we do have digit arrays (one per chamber) which contains
do {
ix = gRandom->Integer(maxIx+1);
iy = gRandom->Integer(maxIy+1);
- pad = seg->PadByIndices(AliMpIntPair(ix,iy),kFALSE);
+ pad = seg->PadByIndices(ix,iy,kFALSE);
} while ( !pad.IsValid() );
- Int_t manuId = pad.GetLocation().GetFirst();
- Int_t manuChannel = pad.GetLocation().GetSecond();
+ Int_t manuId = pad.GetManuId();
+ Int_t manuChannel = pad.GetManuChannel();
AliMUONVCalibParam* pedestals = fCalibrationData->Pedestals(detElemId,manuId);
fLogger->Log("Added noiseOnly digit");
}
}
- else
- {
- AliError("Pure noise below threshold. This should not happen. Not adding "
- "this digit.");
- }
delete d;
}
}
const AliMpVSegmentation* seg
= AliMpSegmentation::Instance()->GetMpSegmentation(currDetElemId,AliMp::GetCathodType(0));
if (!seg) continue;
- Float_t deltax = seg->Dimensions().X();
- Float_t deltay = seg->Dimensions().Y();
+ Float_t deltax = seg->GetDimensionX();
+ Float_t deltay = seg->GetDimensionY();
GetTransformer()->Local2Global(currDetElemId, -deltax, -deltay, 0, xg01, yg01, zg);
GetTransformer()->Local2Global(currDetElemId, deltax, deltay, 0, xg02, yg02, zg);
Float_t xg1 = xg01, xg2 = xg02, yg1 = yg01, yg2 = yg02;
if(gx>=xg1 && gx<=xg2 && gy>=yg1 && gy<=yg2){
detElemId = currDetElemId;
GetTransformer()->Global2Local(detElemId, gx, gy, 0, x, y, z);
- pad[0] = seg->PadByPosition(TVector2(x,y),kFALSE);
+ pad[0] = seg->PadByPosition(x,y,kFALSE);
if(!pad[0].IsValid()) continue;
isOk = kTRUE;
break;
const AliMpVSegmentation* seg1
= AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(1));
- pad[1] = seg1->PadByPosition(TVector2(x,y),kFALSE);
+ pad[1] = seg1->PadByPosition(x,y,kFALSE);
for ( Int_t cathode = 0; cathode < 2; ++cathode ){
- Int_t manuId = pad[cathode].GetLocation(0).GetFirst();
- Int_t manuChannel = pad[cathode].GetLocation(0).GetSecond();
+ Int_t manuId = pad[cathode].GetLocalBoardId(0);
+ Int_t manuChannel = pad[cathode].GetLocalBoardChannel(0);
d[cathode] = digitStore.CreateDigit(detElemId,manuId,manuChannel,cathode);
- ix = pad[cathode].GetIndices().GetFirst();
- iy = pad[cathode].GetIndices().GetSecond();
+ ix = pad[cathode].GetIx();
+ iy = pad[cathode].GetIy();
d[cathode]->SetPadXY(ix,iy);
//d[cathode].SetSignal(1);
//d[cathode].SetPhysicsSignal(0);