AliMUONSimpleClusterServer* clusterServer = NULL;
try
{
- calibrator = new AliMUONDigitCalibrator(
- *fCalibrationData, fRecoParam->GetCalibrationMode()
- );
+ calibrator = new AliMUONDigitCalibrator(*fCalibrationData, fRecoParam);
clusterFinder = AliMUONReconstructor::CreateClusterFinder(
fRecoParam->GetClusteringMode()
AliMUONDigitizerV3* digitizer = new AliMUONDigitizerV3(manager, fDigitizerWithNoise);
AliMUONDigitizerV3::SetNSigmas(fDigitizerNSigmas);
- digitizer->SetCalibrationData(fCalibrationData);
+ digitizer->SetCalibrationData(fCalibrationData,GetRecoParam());
return digitizer;
}
if (!fDigitCalibrator)
{
- AliMUONRecoParam* recoParam = 0x0;
-
- AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
-
- if (entry)
- {
- // load recoParam according OCDB content (single or array)
- if (!(recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject())))
- {
- TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject());
-
- for(Int_t i = 0; i < recoParamArray->GetEntriesFast(); ++i)
- {
- recoParam = static_cast<AliMUONRecoParam*>(recoParamArray->UncheckedAt(i));
- if (recoParam && recoParam->IsDefault()) break;
- recoParam = 0x0;
- }
- }
- }
+ AliMUONRecoParam* recoParam = GetRecoParam();
if (!recoParam)
{
AliFatal("Cannot work without recoparams !");
}
- TString calibMode = recoParam->GetCalibrationMode();
-
- fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,recoParam,calibMode.Data());
+ fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,recoParam);
}
fDigitMaker->Raw2Digits(rawReader,sDigitStore,triggerStore);
}
+//____________________________________________________________________
+AliMUONRecoParam* AliMUON::GetRecoParam() const
+{
+ AliMUONRecoParam* recoParam = 0x0;
+
+ AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
+
+ if (entry)
+ {
+ // load recoParam according OCDB content (single or array)
+ if (!(recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject())))
+ {
+ TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject());
+
+ for(Int_t i = 0; i < recoParamArray->GetEntriesFast(); ++i)
+ {
+ recoParam = static_cast<AliMUONRecoParam*>(recoParamArray->UncheckedAt(i));
+ if (recoParam && recoParam->IsDefault()) break;
+ recoParam = 0x0;
+ }
+ }
+ }
+ return recoParam;
+}
+
class AliMUONVHitStore;
class AliMUONCalibrationData;
class AliMUONDigitCalibrator;
+class AliMUONRecoParam;
class AliLoader;
const AliMUONGeometry* GetGeometry() const;
+ AliMUONRecoParam* GetRecoParam() const;
+
Int_t fNCh; ///< Number of chambers
Int_t fNTrackingCh; ///< Number of tracking chambers*
Int_t fSplitLevel; ///< Splitlevel when making branches in outfiles.
AliMUONCalibrationData* fCalibrationData; ///< pointer of calibration data
- AliMUONDigitCalibrator* fDigitCalibrator; ///< digit calibrator (for raw2sdigits)
+ AliMUONDigitCalibrator* fDigitCalibrator; //!< digit calibrator (for raw2sdigits)
- ClassDef(AliMUON,24) // MUON Detector base class
+ ClassDef(AliMUON,25) // MUON Detector base class
};
#endif
const Int_t AliMUONDigitCalibrator::fgkInjectionGain(3);
//_____________________________________________________________________________
-AliMUONDigitCalibrator::AliMUONDigitCalibrator(Int_t runNumber, const char* calibMode)
+AliMUONDigitCalibrator::AliMUONDigitCalibrator(Int_t runNumber)
: TObject(),
fLogger(new AliMUONLogger(20000)),
fStatusMaker(0x0),
if ( o->IsA() == TObjArray::Class() )
{
TObjArray* a = static_cast<TObjArray*>(o);
+// a->SetOwner(kTRUE); // FIXME: this should be done but somehow makes the reco crash at the end at cleaning stage... investigate why ?
TIter next(a);
AliMUONRecoParam* p;
while ( ( p = static_cast<AliMUONRecoParam*>(next()) ))
AliMUONCalibrationData calib(runNumber);
- Ctor(calibMode,calib,recoParam,kFALSE);
+ Ctor(calib,recoParam,kFALSE);
}
//_____________________________________________________________________________
AliMUONDigitCalibrator::AliMUONDigitCalibrator(const AliMUONCalibrationData& calib,
- const AliMUONRecoParam* recoParams,
- const char* calibMode)
+ const AliMUONRecoParam* recoParams)
: TObject(),
fLogger(new AliMUONLogger(20000)),
fStatusMaker(0x0),
{
/// ctor
- Ctor(calibMode,calib,recoParams);
+ Ctor(calib,recoParams);
}
//_____________________________________________________________________________
-AliMUONDigitCalibrator::AliMUONDigitCalibrator(const AliMUONCalibrationData& calib,
- const char* calibMode)
+AliMUONDigitCalibrator::AliMUONDigitCalibrator(const AliMUONCalibrationData& calib, int /*b*/)
: TObject(),
fLogger(new AliMUONLogger(20000)),
fStatusMaker(0x0),
{
/// ctor
- Ctor(calibMode,calib,0x0);
+ Ctor(calib,0x0);
}
//_____________________________________________________________________________
void
-AliMUONDigitCalibrator::Ctor(const char* calibMode,
- const AliMUONCalibrationData& calib,
+AliMUONDigitCalibrator::Ctor(const AliMUONCalibrationData& calib,
const AliMUONRecoParam* recoParams,
Bool_t deferredInitialization)
{
/// designated ctor
- TString cMode(calibMode);
+ TString cMode("NOGAIN");
+ if (recoParams) cMode=recoParams->GetCalibrationMode();
cMode.ToUpper();
if ( cMode == "NOGAIN" )
}
else
{
- AliError(Form("Invalid calib mode = %s. Will use NOGAIN instead",calibMode));
+ AliError(Form("Invalid calib mode = %s. Will use NOGAIN instead",cMode.Data()));
fApplyGains = fgkNoGain;
}
}
digit->Calibrated(kTRUE);
+ digit->ChargeInFC(kTRUE);
Float_t charge(0.0);
Int_t statusMap;
Bool_t ok = IsValidDigit(digit->DetElemId(),digit->ManuId(),digit->ManuChannel(),&statusMap);
digit->SetStatusMap(statusMap);
-
+
if (ok)
{
charge = CalibrateDigit(digit->DetElemId(),digit->ManuId(),digit->ManuChannel(),
digit->SetCharge(charge);
digit->Saturated(isSaturated);
+
}
}
{
/// Check if a given pad is ok or not.
+ // initialize the statusmap to dead by default
+ if (statusMap) *statusMap = AliMUONPadStatusMapMaker::SelfDeadMask();
+
// First a protection against bad input parameters
AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(detElemId);
if (!de) return kFALSE; // not existing DE
// ok, now we have a valid channel number, so let's see if that pad
// behaves or not ;-)
- Int_t sm = fStatusMapMaker->StatusMap(detElemId,manuId,manuChannel);
+ Int_t sm = StatusMap(detElemId,manuId,manuChannel);
if (statusMap) *statusMap = sm;
{
public:
- AliMUONDigitCalibrator(Int_t runNumber, const char* calibMode="NOGAIN");
+ AliMUONDigitCalibrator(Int_t runNumber);
AliMUONDigitCalibrator(const AliMUONCalibrationData& calib,
- const AliMUONRecoParam* recoParams,
- const char* calibMode="NOGAIN");
+ const AliMUONRecoParam* recoParams);
- AliMUONDigitCalibrator(const AliMUONCalibrationData& calib,
- const char* calibMode="NOGAIN");
+ AliMUONDigitCalibrator(const AliMUONCalibrationData& calib, int b);
virtual ~AliMUONDigitCalibrator();
/// Not implemented
AliMUONDigitCalibrator& operator=(const AliMUONDigitCalibrator& other);
- void Ctor(const char* calibMode,
- const AliMUONCalibrationData& calib,
+ void Ctor(const AliMUONCalibrationData& calib,
const AliMUONRecoParam* recoParams,
Bool_t deferredInitialization=kTRUE);
#include "AliMUONVCalibParam.h"
#include "AliMUONVDigitStore.h"
#include "AliMUONGeometryTransformer.h" //ADDED for trigger noise
+#include "AliMUONRecoParam.h"
#include "AliMUONTriggerChamberEfficiency.h"
#include "AliMUONTriggerUtilities.h"
//-----------------------------------------------------------------------------
/// \class AliMUONDigitizerV3
+///
/// The digitizer is performing the transformation to go from SDigits (digits
/// w/o any electronic noise) to Digits (w/ electronic noise, and decalibration)
///
/// (for performance reason mainly, and because anyway we know we have to do it
/// here, at the digitization level).
///
+/// August 2011. In order to remove the need for specific MC OCDB storages,
+/// we're introducing a dependence of simulation on AliMUONRecoParam (stored
+/// in MUON/Calib/RecoParam in OCDB), which is normally (or conceptually, if
+/// you will) only a reconstruction object. That's not a pretty solution, but,
+/// well, we have to do it...
+/// This dependence comes from the fact that we must know how to decalibrate
+/// the digits, so that the decalibration (done here) - calibration (done during
+/// reco) process is (as much as possible) neutral.
+///
+///
/// \author Laurent Aphecetche
+///
//-----------------------------------------------------------------------------
namespace
fDigitStore(0x0),
fOutputDigitStore(0x0),
fInputDigitStores(0x0),
+fRecoParam(0x0),
fTriggerEfficiency(0x0),
fTriggerUtilities(0x0),
fEfficiencyResponse(2*AliMUONConstants::NTriggerCh()*AliMUONConstants::NTriggerCircuit())
/// - add some electronics noise (thus leading to a realistic adc), if requested to do so
/// - sets the signal to zero if below 3*sigma of the noise
- Float_t charge = digit.IsChargeInFC() ? digit.Charge()*AliMUONConstants::FC2ADC() : digit.Charge();
+ Float_t charge = digit.Charge();
+
+ if (!digit.IsChargeInFC())
+ {
+ charge *= AliMUONConstants::DefaultADC2MV()*AliMUONConstants::DefaultA0()*AliMUONConstants::DefaultCapa();
+ fLogger->Log("CHECK ME ! WAS NOT SUPPOSED TO BE HERE !!! ARE YOU RECONSTRUCTING OLD SIMULATIONS ? ");
+ AliError("CHECK ME ! WAS NOT SUPPOSED TO BE HERE !!! ARE YOU RECONSTRUCTING OLD SIMULATIONS ? ");
+ }
// We set the charge to 0, as the only relevant piece of information
// after Digitization is the ADC value.
}
Int_t adc = DecalibrateTrackerDigit(*pedestal,*gain,manuChannel,charge,addNoise,
- digit.IsNoiseOnly());
+ digit.IsNoiseOnly(),
+ fRecoParam->GetCalibrationMode());
digit.SetADC(adc);
}
Int_t channel,
Float_t charge,
Bool_t addNoise,
- Bool_t noiseOnly)
+ Bool_t noiseOnly,
+ const TString& calibrationMode)
{
/// Decalibrate (i.e. go from charge to adc) a tracker digit, given its
/// pedestal and gain parameters.
/// Must insure before calling that channel is valid (i.e. between 0 and
/// pedestals or gains->GetSize()-1, but also corresponding to a valid channel
/// otherwise results are not predictible...)
-
+ ///
+ /// This method is completely tied to what happens in its sister method :
+ /// AliMUONDigitCalibrator::CalibrateDigit, which is doing the reverse work...
+ ///
+
static const Int_t kMaxADC = (1<<12)-1; // We code the charge on a 12 bits ADC.
+ Bool_t nogain = calibrationMode.Contains("NOGAIN");
+
+ Float_t a1(0.0);
+ Int_t thres(4095);
+ Int_t qual(0xF);
+ Float_t capa(AliMUONConstants::DefaultCapa()); // capa = 0.2 and a0 = 1.25
+ Float_t a0(AliMUONConstants::DefaultA0()); // is equivalent to gain = 4 mV/fC
+ Float_t adc2mv(AliMUONConstants::DefaultADC2MV()); // 1 ADC channel = 0.61 mV
+
+ if ( ! nogain )
+ {
+ a0 = gains.ValueAsFloat(channel,0);
+ a1 = gains.ValueAsFloat(channel,1);
+ thres = gains.ValueAsInt(channel,2);
+ qual = gains.ValueAsInt(channel,3);
+ }
+
Float_t pedestalMean = pedestals.ValueAsFloat(channel,0);
Float_t pedestalSigma = pedestals.ValueAsFloat(channel,1);
AliDebugClass(1,Form("DE %04d MANU %04d CH %02d PEDMEAN %7.2f PEDSIGMA %7.2f",
pedestals.ID0(),pedestals.ID1(),channel,pedestalMean,pedestalSigma));
- Float_t a0 = gains.ValueAsFloat(channel,0);
- Float_t a1 = gains.ValueAsFloat(channel,1);
- Int_t thres = gains.ValueAsInt(channel,2);
- Int_t qual = gains.ValueAsInt(channel,3);
-
if ( qual <= 0 ) return 0;
Float_t chargeThres = a0*thres;
Float_t padc(0); // (adc - ped) value
- if ( charge <= chargeThres || TMath::Abs(a1) < 1E-12 )
+ if ( nogain || charge <= chargeThres || TMath::Abs(a1) < 1E-12 )
{
// linear part only
}
else
{
+ // FIXME: when we'll use capacitances and real gains, revise this part
+ // to take capa properly into account...
+
+ AliWarningClass("YOU PROBABLY NEED TO REVISE THIS PART OF CODE !!!");
+
// linear + parabolic part
Double_t qt = chargeThres - charge;
Double_t delta = a0*a0-4*a1*qt;
}
}
+ padc /= capa*adc2mv;
+
Int_t adc(0);
Float_t adcNoise = 0.0;
return f;
}
+//_____________________________________________________________________________
+void AliMUONDigitizerV3::SetCalibrationData(AliMUONCalibrationData* calibrationData,
+ AliMUONRecoParam* recoParam)
+{
+ fCalibrationData = calibrationData;
+ fRecoParam = recoParam;
+ if (!fRecoParam)
+ {
+ AliError("Cannot work (e.g. decalibrate) without recoparams !");
+ }
+}
+
class AliMUONVTriggerStore;
class AliMUONTriggerElectronics;
class AliMUONVCalibParam;
+class AliMUONRecoParam;
class AliMUONTriggerChamberEfficiency;
class AliMUONTriggerUtilities;
Int_t channel,
Float_t charge,
Bool_t addNoise=kFALSE,
- Bool_t noiseOnly=kFALSE);
+ Bool_t noiseOnly=kFALSE,
+ const TString& calibrationMode="NOGAIN");
- /// Set calibration data
- void SetCalibrationData(AliMUONCalibrationData* calibrationData)
- {fCalibrationData = calibrationData;}
+ /// Set calibration (and recoparam) data
+ void SetCalibrationData(AliMUONCalibrationData* calibrationData, AliMUONRecoParam* recoParam);
/// Set the number of sigmas for pedestal cut
static void SetNSigmas(Double_t nsigmas=4.0) { fgNSigmas = nsigmas; }
AliMUONVDigitStore* fDigitStore; //!< temporary digits
AliMUONVDigitStore* fOutputDigitStore; //!< digits we'll output to disk
TObjArray* fInputDigitStores; //!< input digit stores (one per input file
+ AliMUONRecoParam* fRecoParam; //!< reco params (to know how to decalibrate) (not owner)
AliMUONTriggerChamberEfficiency* fTriggerEfficiency; //!< trigger efficiency map
AliMUONTriggerUtilities* fTriggerUtilities; //!< Trigger utilities for masks
TArrayI fEfficiencyResponse; //!< Local board efficiency response
- ClassDef(AliMUONDigitizerV3,10) // MUON Digitizer V3-9
+ ClassDef(AliMUONDigitizerV3,11) // MUON Digitizer V3-11
};
#endif
/// Set the calibration status
virtual void Calibrated(Bool_t value) { SetBit(kCalibrated,value); }
+ /// Whether this digit has its charge already in fC
+ virtual Bool_t IsChargeInFC() const { return TestBit(kChargeInFC); }
+ /// Set the charge unit value
+ virtual void ChargeInFC(Bool_t value=kTRUE) { SetBit(kChargeInFC,value); }
+
/// Whether this digit is part of a cluster or something else
virtual Bool_t IsUsed() const { return TestBit(kUsed); }
/// Set the used status
{
kSaturated = BIT(20), ///< to indicate that manas amplifier has saturated
kUsed = BIT(21), ///< whether the digit is used (e.g. in a cluster)
- kCalibrated = BIT(22) ///< whether the digit has been calibrated or not
+ kCalibrated = BIT(22), ///< whether the digit has been calibrated or not
+ kChargeInFC = BIT(23) ///< whether the digit has a charge in fC or not
};
- ClassDef(AliMUONRealDigit,1) // Implementation of AliMUONVDigit
+ ClassDef(AliMUONRealDigit,2) // Implementation of AliMUONVDigit
};
#endif
if (IsDefault()) cout<<"\t\t*** Parameters used by default ***"<<endl;
+ cout << "Event Specie=" << GetEventSpecie() << endl;
+
cout<<Form("Calibration mode = %s",fCalibrationMode.Data())<<endl;
cout<<Form("Clustering mode = %s",fClusteringMode.Data())<<endl;
cout<<Form("Tracking mode = %s",fTrackingMode.Data())<<endl;
AliDebug(1,"");
+ delete fDigitCalibrator;
+
delete fDigitMaker;
delete fDigitStore;
delete fTransformer;
delete fTriggerCircuit;
- delete fDigitCalibrator;
- delete fCalibrationData;
- delete fClusterServer;
delete fTriggerStore;
delete fTrackStore;
delete fClusterStore;
delete fTriggerUtilities;
delete AliMpSegmentation::Instance(false);
- delete AliMpDDLStore::Instance(false);
+ delete AliMpDDLStore::Instance(false);
+
+ delete fCalibrationData;
}
//_____________________________________________________________________________
AliWarning("NOSTATUSMAP is obsolete");
}
- TString calibMode = GetRecoParam()->GetCalibrationMode();
-
- fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam(),calibMode.Data());
+ fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,GetRecoParam());
}
//_____________________________________________________________________________
qtot = AliMUONConstants::ReducedQTot(qtot,timeDif);
}
+ // Scale the charge to it'll (roughly) be in fC
+ qtot *= AliMUONConstants::DefaultADC2MV()*AliMUONConstants::DefaultA0()*AliMUONConstants::DefaultCapa();
+
// Get the charge correlation between cathodes.
Float_t currentCorrel = TMath::Exp(gRandom->Gaus(0.0,ChargeCorrel()/2.0));
Float_t qp = TMath::Abs(fMathieson->IntXY(lowerLeft.X(),lowerLeft.Y(),
upperRight.X(),upperRight.Y()));
- Int_t icharge = Int_t(qp*qcath);
-
- if ( qp > fChargeThreshold )
+ if ( qp > fChargeThreshold &&
+ qp*qcath > AliMUONConstants::DefaultADC2MV()*AliMUONConstants::DefaultA0()*AliMUONConstants::DefaultCapa() )
{
// If we're above threshold, then we create a digit,
// and fill it with relevant information, including electronics.
+
+ // note that the second condition above is to be backward compatible (when
+ // the sdigitizer was making a cut on Int_t(qp*qcath) > 0 and qcath was in ADC, not in fC)
+
AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetManuId(),
pad.GetManuChannel(),cath);
d->SetPadXY(pad.GetIx(),pad.GetIy());
- d->SetCharge(icharge);
+ d->SetCharge(qp*qcath);
digits.Add(d);
}
it->Next();
while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
{
- if ( d->Charge() > 0 ) // that check would be better in the disintegrate
- // method, but to compare with old sdigitizer, it has to be there.
+ d->ChargeInFC(kTRUE);
+
+ AliMUONVDigit* added = sDigitStore->Add(*d,AliMUONVDigitStore::kMerge);
+ if (!added)
{
- AliMUONVDigit* added = sDigitStore->Add(*d,AliMUONVDigitStore::kMerge);
- if (!added)
- {
- AliError("Could not add digit to digitStore");
- }
+ AliError("Could not add digit to digitStore");
}
}
-
+
treeS->Fill();
loader->WriteSDigits("OVERWRITE");
AliCDBManager::Instance()->SetDefaultStorage(storage);
}
- fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,recoParam,calibMode);
+ fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,recoParam);
//FIXME: get the reco param from GUI and/or from OCDB if not used from the QA code ?
}
}
/// Also, if HasGeometryInformation is true, the digit knows the position and
/// the (half) dimensions (in cm) of the pad it corresponds to.
///
+/// Note 1.
+///
+/// Please note that IsCalibrated and IsChargeInFC are two
+/// concepts closely related, but not equivalent, at least for SDigits.
+///
+/// For instance a SDigit can have its charge in fC but not being calibrated.
+///
+/// { SDigits coming from a simulation are yet to be merged (i.e. the
+/// SDigitStore can contain several SDigits objects per channel), so, while
+/// their charge is in femto-coulomb, they are not calibrated (e.g. pedestal
+/// is not subtracted yet). }
+///
+/// Conversely, a calibrated (s)digit always has its charge in fC.
+///
/// \author Laurent Aphecetche, Subatech
//-----------------------------------------------------------------------------
AliMUONVDigit::Print(Option_t* opt) const
{
/// Dump to screen.
+ ///
/// If opt=="tracks", info on tracks are printed too.
+ ///
+ /// The last part of the printout indicated the status of the digit :
+ /// (S) means that digit is saturated
+ /// (C) means that digit has been calibrated
+ /// [fC] means that digit's charge is in femto-coulombs (fC)
+ /// (U) means that digit is part of (has been used in) a cluster
+ /// (+) is noise-only digit (added by the simulation)
+ /// (X) has the IsConverted flag on (e.g. has been embedded)
+
+ TString options(opt);
+ options.ToLower();
+
+ if ( options.Contains("zs") )
+ {
+ if ( IsCalibrated() && Charge() <= 0 )
+ {
+ return;
+ }
+
+ if ( !IsCalibrated() && ADC() <= 0 )
+ {
+ return;
+ }
+ }
cout << Form("<%s>: ID %12u DE %4d Cath %d (Ix,Iy)=(%3d,%3d) (Manu,Channel)=(%4d,%2d)"
", Charge=%7.2f",
ClassName(),GetUniqueID(),
DetElemId(),Cathode(),PadX(),PadY(),ManuId(),ManuChannel(),Charge());
+
+
if ( IsSaturated() )
{
cout << "(S)";
cout << " ";
}
+ if ( IsChargeInFC() )
+ {
+ cout << "[fC]";
+ }
+ else
+ {
+ cout << " ";
+ }
+
if ( IsUsed() )
{
cout << "(U)";
cout << " ";
}
- cout << Form(" ADC=%4d StatusMap=%04x",ADC(),StatusMap());
+ if ( IsNoiseOnly() )
+ {
+ cout << "(+)";
+ }
+ else
+ {
+ cout << " ";
+ }
+
+ if ( IsConverted() )
+ {
+ cout << "(X)";
+ }
+ else
+ {
+ cout << " ";
+ }
+
+ cout << Form(" ADC=%4d",ADC());
+
+ if ( IsCalibrated() )
+ {
+ // StatusMap is not set before calibration has occured (e.g.
+ // SDigits cannot have it meaningfully filled)
+ cout << Form(" StatusMap=%04x",StatusMap());
+ }
- TString options(opt);
- options.ToLower();
if ( options.Contains("tracks") && HasMCInformation() )
{
cout << " Hit " << setw(3) << Hit();
/// Set the efficiencyApplied status
virtual void EfficiencyApplied(Bool_t /*value*/=kTRUE) {}
- /// Whether this digit has been calibrated or not
+ /// Whether this digit has been calibrated or not (see note 1 in AliMUONVDigit.cxx)
virtual Bool_t IsCalibrated() const=0;
- /// Set the calibrated status
+ /// Set the calibrated status (see note 1 in AliMUONVDigit.cxx)
virtual void Calibrated(Bool_t value)=0;
- /// Whether this digit has charge in femto coulomb
+ /// Whether this digit has charge in femto coulomb (see note 1 in AliMUONVDigit.cxx)
virtual Bool_t IsChargeInFC() const { return kFALSE; }
-
+ /// Set the unit value (see note 1 in AliMUONVDigit.cxx)
+ virtual void ChargeInFC(Bool_t value=kTRUE)=0;
+
/// Whether or not this digit was obtained from a conversion (e.g. real to simulated)
virtual Bool_t IsConverted() const { return kFALSE; }
#RUN=0 # run number for OCDB access
SEED=1234567 # random number generator seed
SIMDIR="generated" # sub-directory where to move simulated files prior to reco
-DUMPEVENT=5 # event to be dump on files
+DUMPEVENT=5 # event to be dump on files (set to negative to skip dumps)
SIMCONFIG="$ALICE_ROOT/MUON/"$MC"Config.C"
EMBEDWITH="" # no embedding by default
+REALISTIC=0 # ideal simulation by default
# next try to see if there are options of this script that want to change the
# defaults
EXIT=0
-while getopts "SRZX:srxzn:tg:p:d:c:e:" option
+while getopts "SRZX:srxzn:tg:p:d:c:e:b:" option
do
case $option in
R ) RECONSTRUCTION=1;;
g ) SEED=$OPTARG;;
p ) RECOPTIONS=$OPTARG;;
e ) EMBEDWITH=$OPTARG;;
+ b )
+ REALISTIC=$OPTARG
+ RAW=0
+ ;;
* ) echo "Unimplemented option chosen."
EXIT=1
;;
echo " -d full path to output directory (default $OUTDIR)"
echo " -c full path to configuration file for simulation (default $SIMCONFIG)"
echo " -e full path to a galice.root file relating to SDigits to be merged (embedding)"
+ echo " -b runnumber (int) make a realistic simulation using runnumber as anchor (default 0=ideal simulation)"
exit 4;
fi
if [ -n "$EMBEDWITH" ]; then
echo "Will embed simulation with $EMBEDWITH"
fi
+if [ "$REALISTIC" -gt 0 ]; then
+ echo "Will use anchor run $REALISTIC"
+fi
if [ "$RECONSTRUCTION" -eq 1 ]; then
echo "Reconstruction options to be used : $RECOPTIONS"
if [ "$RAW" -eq 0 ]; then
echo "Running simulation ..."
- aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\,\""$EMBEDWITH"\"\) > $OUTDIR/testSim.out 2>&1
+ aliroot -l -b -q runSimulation.C\($SEED,$NEVENTS,\""$SIMCONFIG"\"\,\""$EMBEDWITH"\"\,$REALISTIC\) > $OUTDIR/testSim.out 2>&1
mkdir $OUTDIR/$SIMDIR
if [ "$RAW" -eq 1 ]; then
- echo "Moving generated files to $SIMDIR"
- mv $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
- mv $OUTDIR/MUON*.root $OUTDIR/Kinematics*.root $OUTDIR/galice.root $OUTDIR/TrackRefs*.root $OUTDIR/$SIMDIR
+ if [ "$REALISTIC" -eq 0 ]; then # we can not move for realistic simulations as we need e.g. kinematics to propagate the simulated vertex to the reco.
+ echo "Moving generated files to $SIMDIR"
+ mv $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
+ mv $OUTDIR/MUON*.root $OUTDIR/TrackRefs*.root $OUTDIR/$SIMDIR
+ mv $OUTDIR/Kinematics*.root $OUTDIR/galice.root $OUTDIR/$SIMDIR
+ fi
else
echo "Copying generated files to $SIMDIR"
cp $OUTDIR/*QA*.root $OUTDIR/*.log $OUTDIR/$SIMDIR
if [ "$MC" = "g4" ]; then
cp $ALICE_ROOT/MUON/geometry/geometry.root $OUTDIR
fi
+
+ cp $OUTDIR/geometry.root $OUTDIR/$SIMDIR/geometry.root
+
fi
###############################################################################
if [ "$RECONSTRUCTION" -eq 1 ]; then
if [ "$RAW" -eq 1 ]; then
- rm -f galice.root
+ if [ "$REALISTIC" -eq 0 ]; then
+ rm -f galice.root
+ fi
fi
+
+ if [ "$REALISTIC" -ne 0 ]; then
+ rm -f geometry.root
+ fi
rm -f AliESD*.root *QA*.root
cd $OUTDIR
- BOOLEMBED=kFALSE
+ RAWOCDB=kFALSE
if [ -n "$EMBEDWITH" ]; then
- BOOLEMBED=kTRUE
+ RAWOCDB=kTRUE
+ fi
+
+ if [ "$REALISTIC" -gt 0 ]; then
+ RAWOCDB=kTRUE
fi
if [ "$RAW" -eq 1 ]; then
- aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\",$BOOLEMBED\) > $OUTDIR/testReco.out 2>&1
+ aliroot -l -b -q runReconstruction\.C\($SEED,\""$OUTDIR/raw.root"\",\""$RECOPTIONS"\",$RAWOCDB\) > $OUTDIR/testReco.out 2>&1
else
- aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\",$BOOLEMBED\) > $OUTDIR/testReco.out 2>&1
+ aliroot -l -b -q runReconstruction\.C\($SEED,\"""\",\""$RECOPTIONS"\",$RAWOCDB\) > $OUTDIR/testReco.out 2>&1
fi
fi
fi
fi
+
+if [ "$DUMPEVENT" -ge 0 ]; then
echo "Running dumps for selected event ($DUMPEVENT) ..."
fi
fi
+fi
+
echo "Finished"
echo "... see results in $OUTDIR"
void Config(const char* directory="",
const char* option="param",
const char* digitstore="AliMUONDigitStoreV2S",
- bool forEmbedding=kFALSE)
+ bool forEmbedding=kFALSE,
+ bool forRealistic=kFALSE)
{
//=====================================================================
// Config file for MUON test
{ gAlice->Fatal("Config.C","Can not instatiate the Run Loader");
return; }
rl->SetCompressionLevel(2);
- rl->SetNumberOfEventsPerFile(100);
+ rl->SetNumberOfEventsPerFile(10000);
gAlice->SetRunLoader(rl);
//=======================================================================
// For having more debuging messages
gener->SetCutOnChild(1);
gener->SetChildPhiRange(0.,360.);
gener->SetChildThetaRange(171.0,178.0);
- gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
+ gener->SetOrigin(0,0,0); //vertex position gener->SetSigma(0,0,0); //Sigma in (X,Y,Z) (cm) on IP position
+ if (forRealistic)
+ {
+ gener->SetVertexSmear(kPerEvent);
+ }
gener->SetForceDecay(kDiMuon);
gener->SetTrackingFlag(1);
gener->Init();
MUON->SetDigitizerWithNoise(0);
MUON->SetConvertTrigger(true);
- new AliITSv11Hybrid("ITS","ITS v11Hybrid");
-
+ new AliITSv11Hybrid("ITS","ITS v11Hybrid");
+ }
+ else if (forRealistic)
+ {
+ new AliITSv11Hybrid("ITS","ITS v11Hybrid");
}
// Use non-high performance raw data decoder
#endif
Bool_t MUONefficiency(const char* filename = "generated/galice.root", const char* esdFileName = "AliESDs.root",
- const char* geoFilename = "geometry.root", const char* ocdbPath = "local://$ALICE_ROOT/OCDB",
+ const char* geoFilename = "generated/geometry.root", const char* ocdbPath = "local://$ALICE_ROOT/OCDB",
Int_t ExtrapToVertex = -1, Int_t ResType = 553, Int_t FirstEvent = 0, Int_t LastEvent = 1000000 )
{
/// \param ExtrapToVertex (default -1)
//#include <TObjectTable.h>
#endif
-void runReconstruction(int seed, const char* input, const char* recoptions, bool embedding)
+void runReconstruction(int seed, const char* input, const char* recoptions, bool rawocdb)
{
AliCDBManager* man = AliCDBManager::Instance();
- if ( embedding )
+ if ( rawocdb )
{
- cout << "**** WILL USE RAW OCDB AS WE'RE RECONSTRUCTING EMBEDDED DATA" << endl;
- man->SetDefaultStorage("raw://");
- }
+ cout << "**** WILL USE RAW OCDB" << endl;
+ man->SetDefaultStorage("raw://"); //alien://folder=/alice/data/2011/OCDB?cacheFold=/Users/laurent/OCDBcache");
+ man->SetSpecificStorage("ITS/Calib/RecoParam","alien://folder=/alice/cern.ch/user/p/ppillot/OCDB_PbPbSim");
+ }
else
{
man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
man->SetSpecificStorage("GRP/GRP/Data",
Form("local://%s",gSystem->pwd()));
+
}
gRandom->SetSeed(seed);
AliReconstruction* MuonRec = new AliReconstruction("galice.root");
MuonRec->SetInput(gSystem->ExpandPathName(input));
- MuonRec->SetRunReconstruction("MUON");
+ MuonRec->SetRunReconstruction("MUON ITS");
MuonRec->SetFillESD("HLT");
MuonRec->SetOption("HLT", "libAliHLTMUON.so");
- MuonRec->SetNumberOfEventsPerFile(1000);
+ MuonRec->SetNumberOfEventsPerFile(10000);
MuonRec->SetOption("MUON",recoptions);
MuonRec->SetRunQA("MUON:ALL");
MuonRec->SetQAWriteExpert(AliQAv1::kMUON);
void runSimulation(int seed,
int nevents,
const char* config,
- const char* embedwith)
+ const char* embedwith,
+ int runnumber)
{
// Uncoment following lines to run simulation with local residual mis-alignment
// (generated via MUONGenerateGeometryData.C macro)
cout << "***** EMBEDDING MODE : USING RAW OCDB" << endl;
AliCDBManager::Instance()->SetDefaultStorage("raw://");
- AliCDBManager::Instance()->SetSpecificStorage("local://$ALICE_ROOT/OCDB","MUON/Calib/Gains");
AliCDBManager::Instance()->SetSpecificStorage("local://$ALICE_ROOT/OCDB","MUON/Align/Data");
}
+ else if ( runnumber > 0 )
+ {
+ // simulation with anchor run
+
+ cout << "***** ANCHOR RUN MODE : USING RAW OCDB AS MUCH AS POSSIBLE" << endl;
+ cout << "***** AND TAKING VERTEX FROM OCDB IF AVAILABLE" << endl;
+
+ // Last parameter of Config.C indicates we're doing realistic simulations, so we NEED
+ // the ITS in the geometry
+ gAlice->SetConfigFunction("Config(\"\", \"param\", \"AliMUONDigitStoreV2S\",kFALSE,kTRUE);");
+
+ AliCDBManager::Instance()->SetDefaultStorage("raw://");
+ // use something like : "alien://folder=/alice/data/2011/OCDB?cacheFold=/Users/laurent/OCDBcache" instead of "raw://"
+ // if getting slow/problematic accesses to OCDB...
+
+ AliCDBManager::Instance()->SetSpecificStorage("MUON/Align/Data","alien://folder=/alice/cern.ch/user/j/jcastill/LHC10hMisAlignCDB");
+
+ MuonSim.SetRunNumber(runnumber);
+
+ MuonSim.UseVertexFromCDB();
+ }
else
{
gAlice->SetConfigFunction("Config(\"\", \"param\", \"AliMUONDigitStoreV2S\",kFALSE);");
MuonSim.SetTriggerConfig("MUON");
MuonSim.SetWriteRawData("MUON HLT","raw.root",kTRUE);
- MuonSim.SetMakeDigits("MUON");
MuonSim.SetMakeSDigits("MUON");
- MuonSim.SetMakeDigitsFromHits("");
+ MuonSim.SetMakeDigits("MUON ITS"); // ITS needed to propagate the simulated vertex
+ MuonSim.SetMakeDigitsFromHits("ITS"); // ITS needed to propagate the simulated vertex
MuonSim.SetRunHLT("libAliHLTMUON.so chains=dHLT-sim");