HighLAND
Public Types | Public Member Functions | Protected Attributes | List of all members
baseTrackerAnalysis Class Reference

#include <baseTrackerAnalysis.hxx>

Inheritance diagram for baseTrackerAnalysis:
baseAnalysis AnalysisAlgorithm antiNumuCCAnalysis gammaAnalysis nueCCAnalysis numuBkgInAntiNuModeAnalysis numuCC4piAnalysis numuCCAnalysis numuCCMultiPiAnalysis numuCCMultiTargetAnalysis p0dNumuCCAnalysis p0dNumuCCQEAnalysis tutorialAnalysis useTutorialAnalysis

Public Types

enum  enumStandardMicroTrees_baseTrackerAnalysis {
  ntpctracks = enumStandardMicroTreesLast_baseAnalysis+1, ntpcposQualityFV, ntpcnegQualityFV, nfgdtracks,
  nfgdonlytracks, chargeid_ncorrect, chargeid_nwrong, tpcfgdmatch_ncorrect,
  tpcfgdmatch_nwrong, tpctr_ncorrect, tpctr_nwrong, fgdtr_ncorrect,
  fgdtr_nwrong, fgdhybtr_ncorrect, fgdhybtr_nwrong, meeff_ncorrect,
  meeff_nwrong, mepur_ncorrect, mepur_nwrong, tpc_ecal_match_ncorrect,
  tpc_ecal_match_nwrong, tpc_p0d_match_ncorrect, tpc_p0d_match_nwrong, fgd_ecal_match_ncorrect,
  fgd_ecal_match_nwrong, fgd_ecal_smrd_match_ncorrect, fgd_ecal_smrd_match_nwrong, ecal_pid_ncorrect,
  ecal_pid_nwrong, ecal_tr_ncorrect, ecal_tr_nwrong, ecal_emhippid_ncorrect,
  ecal_emhippid_nwrong, fgd2shower_ncorrect, fgd2shower_nwrong, enumStandardMicroTreesLast_baseTrackerAnalysis
}
 
enum  enumConf_baseTrackerAnalysis {
  bfield_syst =baseAnalysis::enumConfLast_baseAnalysis+1, momscale_syst, momresol_syst, momrange_resol_syst,
  tpcpid_syst, fgdpid_syst, chargeideff_syst, tpctrackeff_syst,
  fgdtrackeff_syst, fgdhybridtrackeff_syst, tpcfgdmatcheff_syst, tpcclustereff_syst,
  michel_syst, oofv_syst, pileup_syst, fgdmass_syst,
  sandmu_syst, ecal_emresol_syst, ecal_emscale_syst, tpc_ecal_matcheff_syst,
  tpc_p0d_matcheff_syst, fgd_ecal_matcheff_syst, fgd_ecal_smrd_matcheff_syst, ecal_trackeff_syst,
  ecal_pid_syst, tof_resol_syst, ecal_emhippid_syst, fgd2shower_syst,
  nuetpcpileup_syst, nuep0dpileup_syst, nueecalpileup_syst, nueoofv_syst,
  p0d_elossscale_syst, p0d_elossresol_syst, p0d_veto_syst, enumConfLast_baseTrackerAnalysis
}
 
- Public Types inherited from baseAnalysis
enum  enumStandardMicroTrees_baseAnalysis {
  run = enumStandardMicroTreesLast_AnalysisAlgorithm+1, subrun, evt, evt_time,
  bunch, NWEIGHTS, weight, TruthVertexID,
  TruthVertexNB, RooVtxIndex, RooVtxEntry, RooVtxEntry2,
  RooVtxFile, nu_pdg, nu_trueE, nu_truereac,
  nu_truedir, truelepton_mom, truelepton_costheta, truelepton_dir,
  truevtx_pos, selvtx_det, selvtx_pos, selvtx_truepos,
  true_signal, weight_syst_total_noflux, enumStandardMicroTreesLast_baseAnalysis
}
 
enum  enumConf_baseAnalysis {
  sipion_syst =ConfigurationManager::enumConfLast_ConfigurationManager+1, siproton_syst, nuflux_syst, antinuflux_syst,
  all_syst, zero_var, enumConfLast_baseAnalysis
}
 
- Public Types inherited from AnalysisAlgorithm
enum  enumAnalysisPoint {
  kInitialize =0, kDefineProductions, kDefineInputConverters, kDefineSelections,
  kDefineCorrections, kDefineSystematics, kDefineConfigurations, kDefineMicroTrees,
  kDefineTruthTree, kFillConfigTree, kInitializeSpill, kInitializeBunch,
  kInitializeConfiguration, kInitializeToy, kInitializeSelection, kFinalizeSelection,
  kFinalizeToy, kFillToyVarsInMicroTrees, kFinalizeConfiguration, kFillCategories,
  kFillMicroTrees, kFinalizeBunch, kFillTruthTree, kFinalizeSpill,
  kFinalize
}
 
enum  enumStandardMicroTrees_AnalysisAlgorithm {
  firstCategory = OutputManager::enumStandardMicroTreesLast_OutputManager+1, firstCategoryCounter = firstCategory+NMAXCATEG, entry = firstCategoryCounter + NMAXCATEGCOUNTERS, toy_ref,
  toy_index, toy_par_weight, toy_par_var, NWEIGHTSYST,
  weight_syst, weight_syst_total, weight_corr, weight_corr_total,
  redo, accum_level, first_cut, last_cut =first_cut+NMAXSTEPS,
  enumStandardMicroTreesLast_AnalysisAlgorithm
}
 
enum  enumConfigTree_AnalysisAlgorithm {
  SoftwareVersion =0, HOSTNAME, CMTPATH, INPUTFILE,
  OriginalFile, MinAccumLevelToSave, enumConfigTreeLast_AnalysisAlgorithm
}
 

Public Member Functions

 baseTrackerAnalysis (AnalysisAlgorithm *ana=NULL)
 
virtual bool Initialize ()
 [AnalysisAlgorithm_mandatory]
 
virtual void DefineCorrections ()
 
virtual void DefineSystematics ()
 
virtual void DefineConfigurations ()
 
virtual void DefineMicroTrees (bool addBase=true)
 
virtual void DefineTruthTree ()
 
virtual void FillMicroTrees (bool addBase=true)
 
virtual void FillToyVarsInMicroTrees (bool addBase=true)
 
virtual void FillTruthTreeBase (const AnaTrueVertex &vtx, const SubDetId::SubDetEnum det=SubDetId::kFGD1, bool IsAntinu=false)
 
virtual const ToyBoxTrackerbox (Int_t isel=-1) const
 Returns the ToyBoxTracker.
 
virtual AnaVertexBGetVertex () const
 Returns the vertex for the ToyBoxTracker.
 
virtual AnaTrueVertexBGetTrueVertex () const
 Returns the true vertex for the ToyBoxTracker.
 
- Public Member Functions inherited from baseAnalysis
 baseAnalysis (AnalysisAlgorithm *ana=NULL)
 
virtual bool InitializeSpill ()
 
virtual bool FinalizeConfiguration ()
 
virtual void DefineProductions ()
 
virtual void DefineInputConverters ()
 
virtual bool CheckFillTruthTree (const AnaTrueVertex &vtx)=0
 
virtual void FillTruthTree (const AnaTrueVertex &vtx)=0
 
void FillMicroTreesBase (bool addBase=true)
 
void FillToyVarsInMicroTreesBase (bool addBase=true)
 
void FillTruthTree ()
 
void FillTruthTreeBase (const AnaTrueVertex &vtx, const SubDetId::SubDetEnum det=SubDetId::kFGD1, bool IsAntinu=false)
 
AnaSpillGetSpill ()
 Get a casted AnaSpillC to AnaSpill from the InputManager.
 
AnaBunchGetBunch ()
 Get a casted AnaBunchBB to AnaBunch from the InputManager (TODO the protection)
 
AnaEventGetEvent ()
 Get a casted AnaEventC to AnaEvent.
 
virtual AnaEventCMakeEvent ()
 Create the appropriate event time from an Spill and a Bunch in that spill.
 
void SetSaveRooTracker (bool save)
 Set whether to save the RooTrackerVtx tree or not.
 
void SetRooVtxManager (RooTrackerVtxManager *man)
 Set the RooTrackerVtxManager.
 
- Public Member Functions inherited from AnalysisAlgorithm
 AnalysisAlgorithm (AnalysisAlgorithm *ana=NULL)
 
virtual void Finalize ()
 [AnalysisAlgorithm_optional]
 
virtual void FinalizeSpill ()
 
virtual void InitializeBunch ()
 
virtual void FinalizeBunch ()
 
virtual void InitializeConfiguration ()
 
virtual void InitializeToy ()
 
virtual void FinalizeToy ()
 
virtual void InitializeSelection (const SelectionBase &)
 
virtual void FinalizeSelection (const SelectionBase &)
 
virtual void FillCategories ()
 
virtual void FillConfigTree ()
 
virtual void DefineSelections ()=0
 
void FinalizeToyBase ()
 [AnalysisAlgorithm_mandatory] More...
 
void SetFillSuccessOnly (bool fill)
 Fill trees and process weight systematics only when any of the branches is successful.
 
bool GetFillSuccessOnly ()
 
void SetInitializeTrees (bool ini)
 Initialize trees at the beginning of each configuration.
 
bool GetInitializeTrees ()
 
void SetMinAccumCutLevelToSave (Int_t level)
 Set the minimum accumulated cut level to save an event into the micro-tree.
 
Int_t GetMinAccumCutLevelToSave ()
 Get the minimum accumulated cut level to save an event into the micro-tree.
 
bool CheckAccumLevelToSave ()
 Check if the condition is fulfilled for at least one branch.
 
void SetEvent (AnaEventC *event)
 Set the current event into the algorithm and all used algorithms.
 
void SetToyBox (const ToyBoxB *box, Int_t isel=0)
 Set the current box into the algorithm and all used algorithms. This is useful when one Analysis uses another.
 
void UseAnalysis (AnalysisAlgorithm *ana)
 Used a given analysis.
 
void SetSelectedSelection (Int_t sel)
 Select one of the selections.
 
void SetVersionCheck (bool check)
 Set version checking.
 
void SetAnalysisPoint (enumAnalysisPoint point)
 Set the point of the analysis at which AnalysisLoop is.
 
HighlandInputManagerinput ()
 
SelectionManagersel ()
 
CorrectionManagercorr ()
 
SystematicManagersyst ()
 
EventWeightManagereweight ()
 
EventVariationManagerevar ()
 
OutputManageroutput ()
 
ConfigurationManagerconf ()
 
CategoryManagercat ()
 
DocStringManagerdoc ()
 
virtual const ToyBoxBboxB (Int_t isel=-1) const
 

Protected Attributes

bool _computeEfficiency
 Compute analysis sample efficiency.
 
ChargeIDEffSystematics_chargeid
 
TPCFGDMatchEffSystematics_tpcfgdmatch
 
TPCTrackEffSystematics_tpctr
 
FGDTrackEffSystematics_fgdtr
 
FGDHybridTrackEffSystematics_fgdhybtr
 
MichelElectronEffSystematics_me
 
TPCECalMatchEffSystematics_tpc_ecal_matcheff
 
TPCP0DMatchEffSystematics_tpc_p0d_matcheff
 
FGDECalMatchEffSystematics_fgd_ecal_matcheff
 
FGDECalSMRDMatchEffSystematics_fgd_ecal_smrd_matcheff
 
ECalTrackEffSystematics_ecal_trackeff
 
ECalPIDSystematics_ecal_pid
 
ECalEmHipPIDSystematics_ecal_emhippid
 
FGD2ShowerSystematics_fgd2shower
 
- Protected Attributes inherited from baseAnalysis
RooTrackerVtxManager_rooVtxManager
 the manager of the RooTrackerVtx
 
bool _saveRooTrackerVtxTree
 Save RooTracker tree in output file.
 
FluxWeighting_flux
 Access to the flux weighting.
 
bool _applyFluxWeight
 Flag to enable/disable flux weight.
 
std::string _fluxFile
 Flux file and option.
 
std::string _fluxTuning
 
bool _enableSingleVariationSystConf
 
bool _enableSingleWeightSystConf
 
bool _enableAllSystConfig
 
bool _enableZeroVarConfig
 
Int_t _ntoys
 
Int_t _randomSeed
 
- Protected Attributes inherited from AnalysisAlgorithm
HighlandInputManager_inputManager
 Input Manager: access to the current Event.
 
CorrectionManager_corrManager
 Correction Manager.
 
SystematicManager_systManager
 Systematics Manager.
 
EventWeightManager_weightManager
 EventWeight Manager.
 
EventVariationManager_variationManager
 EventVariation Manager.
 
OutputManager_outputManager
 Output Manager.
 
ConfigurationManager_confManager
 Configuration Manager.
 
SelectionManager_selManager
 
CategoryManager_categManager
 
DocStringManager_docManager
 
const ToyBoxB_box [NMAXSELECTIONS]
 The analysis box.
 
Int_t _min_accum_cut_level
 the minimum accumulated cut level to save an event into the micro-tree
 
bool _fillSuccessOnly
 Fill trees and process weight systematics only when any of the branches is succesful.
 
bool _initializeTrees
 Initialize trees at the beginning of each configuration.
 
AnaEventC_event
 The current event.
 
std::vector< AnalysisAlgorithm * > _usedAnalyses
 The Vector of used analysis.
 
Int_t _selectedSelection
 The selected selection.
 
bool _setMethodCalled
 Boolean parameter to know whether nny of the methods that sets things into used analysis has been called.
 
bool _versionCheck
 
enumAnalysisPoint _analysisPoint
 

Additional Inherited Members

- Protected Member Functions inherited from baseAnalysis
void AddZeroVarConfiguration ()
 

Detailed Description

This class provides a base for user analyses. It handles many common functions, and provides a structure so that users don't have to write too much "boiler-plate" code.

User analyses should inherit from this class.

Definition at line 36 of file baseTrackerAnalysis.hxx.

Constructor & Destructor Documentation

§ baseTrackerAnalysis()

baseTrackerAnalysis::baseTrackerAnalysis ( AnalysisAlgorithm ana = NULL)

Constructor, which instantiates the necessary converters for converting input files to the AnaSpill format.

Definition at line 50 of file baseTrackerAnalysis.cxx.

50  : baseAnalysis(ana){
51 //********************************************************************
52 
53  _chargeid = NULL;
54  _tpcfgdmatch = NULL;
55  _tpctr = NULL;
56  _fgdtr = NULL;
57  _fgdhybtr = NULL;
58  _me = NULL;
59  _tpc_ecal_matcheff = NULL;
60  _tpc_p0d_matcheff = NULL;
61  _fgd_ecal_matcheff = NULL;
62  _fgd_ecal_smrd_matcheff = NULL;
63  _ecal_trackeff = NULL;
64  _ecal_pid = NULL;
65  _fgd2shower = NULL;
66 
67  // Add the package version
68  ND::versioning().AddPackage("baseTrackerAnalysis", anaUtils::GetSoftwareVersionFromPath((std::string)getenv("BASETRACKERANALYSISROOT")));
69 
70  // Don't compute efficiencies by default
71  _computeEfficiency = false;
72 }
void AddPackage(const std::string &name, const std::string &version)
Add a package.
bool _computeEfficiency
Compute analysis sample efficiency.
std::string GetSoftwareVersionFromPath(const std::string &path)
Get The software version from the path of the package.
baseAnalysis(AnalysisAlgorithm *ana=NULL)

Member Function Documentation

§ DefineConfigurations()

void baseTrackerAnalysis::DefineConfigurations ( )
virtual

[baseTrackerAnalysis_all_syst]

[baseTrackerAnalysis_all_syst]

Reimplemented from baseAnalysis.

Reimplemented in tutorialAnalysis.

Definition at line 189 of file baseTrackerAnalysis.cxx.

189  {
190 //********************************************************************
191 
192  // Define all configuration of the base package
193  baseAnalysis::DefineConfigurations();
194 
195  //------- Add and define individual configurations with one systematic only ------------------
196 
197  if (_enableSingleVariationSystConf){
198  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableBFieldDist")){
199  AddConfiguration(conf(), bfield_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
200  conf().EnableEventVariation(SystId::kBFieldDist,bfield_syst);
201  }
202  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableMomScale")){
203  AddConfiguration(conf(), momscale_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
204  conf().EnableEventVariation(SystId::kMomScale,momscale_syst);
205  }
206  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableMomRes")){
207  AddConfiguration(conf(), momresol_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
208  conf().EnableEventVariation(SystId::kMomResol,momresol_syst);
209  }
210  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableMomRangeRes")){
211  AddConfiguration(conf(), momrange_resol_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
212  conf().EnableEventVariation(SystId::kMomRangeResol,momrange_resol_syst);
213  }
214  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableTPCPID")){
215  AddConfiguration(conf(), tpcpid_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
216  conf().EnableEventVariation(SystId::kTpcPid,tpcpid_syst);
217  }
218  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableFGDPID")){
219  AddConfiguration(conf(), fgdpid_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
220  conf().EnableEventVariation(SystId::kFgdPid, fgdpid_syst);
221  }
222  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableECalEMResol")){
223  AddConfiguration(conf(), ecal_emresol_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
224  conf().EnableEventVariation(SystId::kECalEMResol, ecal_emresol_syst);
225  }
226  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableECalEMScale")){
227  AddConfiguration(conf(), ecal_emscale_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
228  conf().EnableEventVariation(SystId::kECalEMScale, ecal_emscale_syst);
229  }
230  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableToFResol")){
231  AddConfiguration(conf(), tof_resol_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
232  conf().EnableEventVariation(SystId::kToFResol, tof_resol_syst);
233  }
234  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableP0DELossScale")){
235  AddConfiguration(conf(), p0d_elossscale_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
236  conf().EnableEventVariation(SystId::kP0DELossScale, p0d_elossscale_syst);
237  }
238  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableP0DELossResol")){
239  AddConfiguration(conf(), p0d_elossresol_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
240  conf().EnableEventVariation(SystId::kP0DELossResol, p0d_elossresol_syst);
241  }
242  }
243 
244  if (_enableSingleWeightSystConf){
245  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableChargeConf")){
246  AddConfiguration(conf(), chargeideff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
247  conf().EnableEventWeight(SystId::kChargeIDEff, chargeideff_syst);
248  }
249  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCTrackEff")){
250  AddConfiguration(conf(), tpctrackeff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
251  conf().EnableEventWeight(SystId::kTpcTrackEff,tpctrackeff_syst);
252  }
253  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDTrackEff")){
254  AddConfiguration(conf(), fgdtrackeff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
255  conf().EnableEventWeight(SystId::kFgdTrackEff,fgdtrackeff_syst);
256  }
257  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDHybridTrackEff")){
258  AddConfiguration(conf(), fgdhybridtrackeff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
259  conf().EnableEventWeight(SystId::kFgdHybridTrackEff,fgdhybridtrackeff_syst);
260  }
261  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCFGDMatchEff")){
262  AddConfiguration(conf(), tpcfgdmatcheff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
263  conf().EnableEventWeight(SystId::kTpcFgdMatchEff,tpcfgdmatcheff_syst);
264  }
265  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableOOFV")){
266  AddConfiguration(conf(), oofv_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
267  conf().EnableEventWeight(SystId::kOOFV,oofv_syst);
268  }
269  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnablePileUp")){
270  AddConfiguration(conf(), pileup_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
271  conf().EnableEventWeight(SystId::kPileUp,pileup_syst);
272  }
273  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDMass")){
274  AddConfiguration(conf(), fgdmass_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
275  conf().EnableEventWeight(SystId::kFgdMass,fgdmass_syst);
276  }
277  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableMichelEleEff")){
278  AddConfiguration(conf(), michel_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
279  conf().EnableEventWeight(SystId::kMichelEleEff,michel_syst);
280  }
281  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableSandMu")){
282  AddConfiguration(conf(), sandmu_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
283  conf().EnableEventWeight(SystId::kSandMu,sandmu_syst);
284  }
285  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCClusterEff")){
286  AddConfiguration(conf(), tpcclustereff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
287  conf().EnableEventWeight(SystId::kTpcClusterEff,tpcclustereff_syst);
288  }
289  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCECalMatchEff")){
290  AddConfiguration(conf(), tpc_ecal_matcheff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
291  conf().EnableEventWeight(SystId::kTpcECalMatchEff, tpc_ecal_matcheff_syst);
292  }
293  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCP0DMatchEff")){
294  AddConfiguration(conf(), tpc_p0d_matcheff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
295  conf().EnableEventWeight(SystId::kTpcP0dMatchEff, tpc_p0d_matcheff_syst);
296  }
297  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDECalMatchEff")){
298  AddConfiguration(conf(), fgd_ecal_matcheff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
299  conf().EnableEventWeight(SystId::kFgdECalMatchEff, fgd_ecal_matcheff_syst);
300  }
301  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDECalSMRDMatchEff")){
302  AddConfiguration(conf(), fgd_ecal_smrd_matcheff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
303  conf().EnableEventWeight(SystId::kFgdECalSmrdMatchEff, fgd_ecal_smrd_matcheff_syst);
304  }
305  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableECalTrackEff")){
306  AddConfiguration(conf(), ecal_trackeff_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
307  conf().EnableEventWeight(SystId::kECalTrackEff, ecal_trackeff_syst);
308  }
309  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableECalPID")){
310  AddConfiguration(conf(), ecal_pid_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
311  conf().EnableEventWeight(SystId::kECalPID, ecal_pid_syst);
312  }
313  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableECalEmHipPID")){
314  AddConfiguration(conf(), ecal_emhippid_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
315  conf().EnableEventWeight(SystId::kECalEmHipPID, ecal_emhippid_syst);
316  }
317  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGD2Shower")){
318  AddConfiguration(conf(), fgd2shower_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
319  conf().EnableEventWeight(SystId::kFGD2Shower, fgd2shower_syst);
320  }
321  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuETPCPileUp")){
322  AddConfiguration(conf(), nuetpcpileup_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
323  conf().EnableEventWeight(SystId::kNuETPCPileUp, nuetpcpileup_syst);
324  }
325  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuEP0DPileUp")){
326  AddConfiguration(conf(), nuep0dpileup_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
327  conf().EnableEventWeight(SystId::kNuEP0DPileUp, nuep0dpileup_syst);
328  }
329  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuEECalPileUp")){
330  AddConfiguration(conf(), nueecalpileup_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
331  conf().EnableEventWeight(SystId::kNuEECalPileUp, nueecalpileup_syst);
332  }
333  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuEOOFV")){
334  AddConfiguration(conf(), nueoofv_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
335  conf().EnableEventWeight(SystId::kNuEOOFV,nueoofv_syst);
336  }
337  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableP0DVeto")){
338  AddConfiguration(conf(), p0d_veto_syst, _ntoys, _randomSeed, new baseToyMaker(_randomSeed));
339  conf().EnableEventWeight(SystId::kP0DVeto,nueoofv_syst);
340  }
341  }
342 
343  //! [baseTrackerAnalysis_all_syst]
344  // Enable all variation systematics in the all_syst configuration (created in baseAnalysis)
345  if ( _enableAllSystConfig){
346  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableBFieldDist")) conf().EnableEventVariation(SystId::kBFieldDist , all_syst);
347  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableMomRes")) conf().EnableEventVariation(SystId::kMomResol , all_syst);
348  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableMomRangeRes")) conf().EnableEventVariation(SystId::kMomRangeResol , all_syst);
349  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableMomScale")) conf().EnableEventVariation(SystId::kMomScale , all_syst);
350  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableTPCPID")) conf().EnableEventVariation(SystId::kTpcPid , all_syst);
351  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableFGDPID")) conf().EnableEventVariation(SystId::kFgdPid , all_syst);
352  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableECalEMResol")) conf().EnableEventVariation(SystId::kECalEMResol , all_syst);
353  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableECalEMScale")) conf().EnableEventVariation(SystId::kECalEMScale , all_syst);
354  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableToFResol")) conf().EnableEventVariation(SystId::kToFResol , all_syst);
355  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableP0DELossScale")) conf().EnableEventVariation(SystId::kP0DELossScale , all_syst);
356  if (ND::params().GetParameterI("baseTrackerAnalysis.Variations.EnableP0DELossResol")) conf().EnableEventVariation(SystId::kP0DELossResol , all_syst);
357  }
358 
359  // Enable all Event Weights in the default and all_syst configurations
360  for (std::vector<ConfigurationBase* >::iterator it= conf().GetConfigurations().begin();it!=conf().GetConfigurations().end();it++){
361  Int_t index = (*it)->GetIndex();
362  if (index != ConfigurationManager::default_conf && (index != all_syst || !_enableAllSystConfig)) continue;
363 
364  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableChargeConf")) conf().EnableEventWeight(SystId::kChargeIDEff , index);
365  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnablePileUp")) conf().EnableEventWeight(SystId::kPileUp , index);
366  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableMichelEleEff")) conf().EnableEventWeight(SystId::kMichelEleEff , index);
367  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCTrackEff")) conf().EnableEventWeight(SystId::kTpcTrackEff , index);
368  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDTrackEff")) conf().EnableEventWeight(SystId::kFgdTrackEff , index);
369  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDHybridTrackEff")) conf().EnableEventWeight(SystId::kFgdHybridTrackEff , index);
370  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCFGDMatchEff")) conf().EnableEventWeight(SystId::kTpcFgdMatchEff , index);
371  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableOOFV")) conf().EnableEventWeight(SystId::kOOFV , index);
372  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCClusterEff")) conf().EnableEventWeight(SystId::kTpcClusterEff , index);
373  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDMass")) conf().EnableEventWeight(SystId::kFgdMass , index);
374  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableSandMu")) conf().EnableEventWeight(SystId::kSandMu , index);
375  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCECalMatchEff")) conf().EnableEventWeight(SystId::kTpcECalMatchEff , index);
376  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableTPCP0DMatchEff")) conf().EnableEventWeight(SystId::kTpcP0dMatchEff , index);
377  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDECalMatchEff")) conf().EnableEventWeight(SystId::kFgdECalMatchEff , index);
378  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGDECalSMRDMatchEff")) conf().EnableEventWeight(SystId::kFgdECalSmrdMatchEff , index);
379  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableECalTrackEff")) conf().EnableEventWeight(SystId::kECalTrackEff , index);
380  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableECalPID")) conf().EnableEventWeight(SystId::kECalPID , index);
381  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableECalEmHipPID")) conf().EnableEventWeight(SystId::kECalEmHipPID , index);
382  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableFGD2Shower")) conf().EnableEventWeight(SystId::kFGD2Shower , index);
383  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuETPCPileUp")) conf().EnableEventWeight(SystId::kNuETPCPileUp , index);
384  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuEP0DPileUp")) conf().EnableEventWeight(SystId::kNuEP0DPileUp , index);
385  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuEECalPileUp")) conf().EnableEventWeight(SystId::kNuEECalPileUp , index);
386  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableNuEOOFV")) conf().EnableEventWeight(SystId::kNuEOOFV , index);
387  if (ND::params().GetParameterI("baseTrackerAnalysis.Weights.EnableP0DVeto")) conf().EnableEventWeight(SystId::kP0DVeto , index);
388  }
389  //! [baseTrackerAnalysis_all_syst]
390 
391  // A configuration with all syst but zero variation applied
393  AddZeroVarConfiguration();
394 
395 }
bool _enableZeroVarConfig
std::vector< ConfigurationBase * > & GetConfigurations()
return the vector of configurations
Creates ToyExperiments.
void EnableEventWeight(Int_t syst, Int_t conf=-1)
Enable the systematic registered with the given index.
void EnableEventVariation(Int_t syst, Int_t conf=-1)
Enable the systematic registered with the given index.

§ DefineSystematics()

void baseTrackerAnalysis::DefineSystematics ( )
virtual

[baseTrackerAnalysis_varsyst]

[baseTrackerAnalysis_varsyst]

[baseTrackerAnalysis_weightsyst]

[baseTrackerAnalysis_weightsyst]

Reimplemented from baseAnalysis.

Reimplemented in tutorialAnalysis.

Definition at line 75 of file baseTrackerAnalysis.cxx.

75  {
76 //********************************************************************
77 
78  //------------ Add Variation systematics ------------
79  //! [baseTrackerAnalysis_varsyst]
80  evar().AddEventVariation(SystId::kBFieldDist, "BFieldDist", new BFieldDistortionSystematics());
81  evar().AddEventVariation(SystId::kMomScale, "MomScale", new MomentumScaleSystematics());
82  evar().AddEventVariation(SystId::kMomResol, "MomResol", new MomentumResolSystematics());
83  evar().AddEventVariation(SystId::kMomRangeResol, "MomRangeResol", new MomRangeResolSystematics());
84  evar().AddEventVariation(SystId::kTpcPid, "TpcPid", new TPCPIDSystematics());
85  evar().AddEventVariation(SystId::kFgdPid, "FgdPid", new FGDPIDSystematics());
86  //! [baseTrackerAnalysis_varsyst]
87 
88  evar().AddEventVariation(SystId::kECalEMResol, "ECalEMResol", new ECalEMEnergyResolSystematics());
89  evar().AddEventVariation(SystId::kECalEMScale, "ECalEMScale", new ECalEMEnergyScaleSystematics());
90 
91  evar().AddEventVariation(SystId::kToFResol, "ToFResol", new ToFResolSystematics());
92  evar().AddEventVariation(SystId::kP0DELossScale, "P0DELossScale", new P0DELossScaleSystematics());
93  evar().AddEventVariation(SystId::kP0DELossResol, "P0DELossResol", new P0DELossResolSystematics());
94 
95 
96  //-------------- Add Event Weights ------------------
97 
98  // compute efficiency using truth for eff-like systematics
99  _computeEfficiency = (bool)ND::params().GetParameterI("baseTrackerAnalysis.Systematics.ComputeEfficiency");
100 
101  _chargeid = new ChargeIDEffSystematics( _computeEfficiency);
102  _tpcfgdmatch = new TPCFGDMatchEffSystematics( _computeEfficiency);
107  _tpc_ecal_matcheff = new TPCECalMatchEffSystematics( _computeEfficiency);
108  _tpc_p0d_matcheff = new TPCP0DMatchEffSystematics( _computeEfficiency);
109  _fgd_ecal_matcheff = new FGDECalMatchEffSystematics( _computeEfficiency);
110  _fgd_ecal_smrd_matcheff = new FGDECalSMRDMatchEffSystematics( _computeEfficiency);
111  _ecal_trackeff = new ECalTrackEffSystematics( _computeEfficiency);
112  _ecal_pid = new ECalPIDSystematics( _computeEfficiency);
113  _ecal_emhippid = new ECalEmHipPIDSystematics( _computeEfficiency);
114  _fgd2shower = new FGD2ShowerSystematics( _computeEfficiency);
115 
116  //BELOW the order is the same as in psyche, so that each throws can be exactly the same as in psyche.
117  eweight().AddEventWeight(SystId::kChargeIDEff, "ChargeIDEff", _chargeid);
118  eweight().AddEventWeight(SystId::kTpcClusterEff, "TpcClusterEff", new TPCClusterEffSystematics());
119  eweight().AddEventWeight(SystId::kTpcTrackEff, "TpcTrackEff", _tpctr);
120  eweight().AddEventWeight(SystId::kTpcFgdMatchEff, "TpcFgdMatchEff", _tpcfgdmatch);
121  eweight().AddEventWeight(SystId::kFgdTrackEff, "FgdTrackEff", _fgdtr);
122  eweight().AddEventWeight(SystId::kFgdHybridTrackEff, "FgdHybridTrackEff", _fgdhybtr);
123  eweight().AddEventWeight(SystId::kMichelEleEff, "MichelEleEff", _me);
124  //! [baseTrackerAnalysis_weightsyst]
125  eweight().AddEventWeight(SystId::kPileUp, "PileUp", new PileUpSystematics());
126  eweight().AddEventWeight(SystId::kFgdMass, "FgdMass", new FGDMassSystematics());
127  eweight().AddEventWeight(SystId::kOOFV, "OOFV", new OOFVSystematics());
128  eweight().AddEventWeight(SystId::kSandMu, "SandMu", new SandMuonsSystematics());
129  //! [baseTrackerAnalysis_weightsyst]
130  eweight().AddEventWeight(SystId::kTpcECalMatchEff, "TpcECalMatchEff", _tpc_ecal_matcheff);
131  eweight().AddEventWeight(SystId::kTpcP0dMatchEff, "TpcP0dMatchEff", _tpc_p0d_matcheff);
132  eweight().AddEventWeight(SystId::kFgdECalMatchEff, "FgdECalMatchEff", _fgd_ecal_matcheff);
133  eweight().AddEventWeight(SystId::kFgdECalSmrdMatchEff, "FgdECalSMRDMatchEff", _fgd_ecal_smrd_matcheff);
134  eweight().AddEventWeight(SystId::kECalTrackEff, "ECalTrackEff", _ecal_trackeff);
135  eweight().AddEventWeight(SystId::kECalPID, "ECalPID", _ecal_pid);
136  eweight().AddEventWeight(SystId::kECalEmHipPID, "ECalEmHipPID", _ecal_emhippid);
137  eweight().AddEventWeight(SystId::kFGD2Shower, "Fgd2Shower", _fgd2shower);
138  eweight().AddEventWeight(SystId::kNuETPCPileUp, "nueTPCPileup", new nueTPCPileUpSystematics());
139  eweight().AddEventWeight(SystId::kNuEP0DPileUp, "nueP0DPileup", new nueP0DPileUpSystematics());
140  eweight().AddEventWeight(SystId::kNuEECalPileUp, "nueEcalPileup", new nueECalPileUpSystematics());
141  eweight().AddEventWeight(SystId::kNuEOOFV, "nueOOFV", new nueOOFVSystematics());
142  eweight().AddEventWeight(SystId::kP0DVeto, "P0DVeto", new P0DVetoSystematics());
143 
144  // This must be called here (after adding all other systematics) such that the order in which they are added is the same as before (in baseAnalysis).
145  // Otherwise the random throws will be different. TODO. Is this still true ?
146  baseAnalysis::DefineSystematics();
147 }
TN-152 for a longer explanaition.
bool _computeEfficiency
Compute analysis sample efficiency.
This is a normalization systematic. It takes into account the uncertainty on the FGD mass introduced ...
This systematic evaluates the oofv systematic for nue analysis. At the moment a 30% rate unceratinty ...
void AddEventVariation(Int_t index, EventVariationBase *sys)
Add a new Event Variation provided its index in the manager and a pointer to it.
void AddEventWeight(Int_t index, EventWeightBase *sys)
Add a new Event Weight provided its index in the manager and a pointer to it.
TN-152 for a longer explanaition.
Charge confusion systematic. This is treated as an efficiency systematic, applying a weight to the ev...
This systematic smears the pull of each FGD track segment.
This systematic smears the CT of each TPC track segment.
Michel electron effciency systematic.

The documentation for this class was generated from the following files: