HighLAND
psyche
psycheSystematics
v3r12
src
ECalEMEnergyScaleSystematics.cxx
1
#include "ECalEMEnergyScaleSystematics.hxx"
2
3
//#define DEBUG
4
5
6
//********************************************************************
7
void
ECalEMEnergyScaleSystematics::Apply
(
const
ToyExperiment
& toy,
AnaEventC
& event){
8
//********************************************************************
9
10
// Get the SystBox for this event
11
SystBoxB
* box =
GetSystBox
(event);
12
13
#ifdef DEBUG
14
std::cout <<
"ECalEMEnergyScaleSystematics::ApplyVariation(): "
<< box->
nRelevantRecObjects
<< std::endl;
15
#endif
16
17
// Loop over the relevant tracks for this systematic
18
for
(Int_t itrk=0;itrk<box->
nRelevantRecObjects
;itrk++){
19
AnaTrackB
* track =
static_cast<
AnaTrackB
*
>
(box->RelevantRecObjects[itrk]);
20
21
if
(!track)
continue
;
22
23
// Get ECal segment
24
AnaECALParticleB
* ecalTrack = track->
ECALSegments
[0];
25
26
if
(!ecalTrack)
continue
;
27
28
#ifdef DEBUG
29
std::cout << itrk <<
" EM Energy before the tweak --> em_0 = "
<< ecalTrack->
EMEnergy
<< std::endl;
30
#endif
31
32
Float_t scaleError;
33
Int_t index;
34
35
// Get the systematic source values
36
if
(!
GetBinSigmaValue
(ecalTrack->
EMEnergy
, scaleError, index))
continue
;
37
38
#ifdef DEBUG
39
std::cout <<
" bin values: scaleError "
<< scaleError <<
" index "
<< index << std::endl;
40
#endif
41
42
// Apply the momentum scale factor
43
ecalTrack->
EMEnergy
*=(1 + scaleError*toy.
GetToyVariations
(
_index
)->
Variations
[index]);
44
45
#ifdef DEBUG
46
std::cout <<
"EMEnergy after the tweak em = "
<< ecalTrack->
EMEnergy
<< std::endl;
47
#endif
48
}
49
}
50
51
SystematicBase::_index
Int_t _index
The index of this systematic (needed by SystematicsManager);.
Definition:
SystematicBase.hxx:112
ToyVariations::Variations
Float_t * Variations
the vector of Variations, one for each of the systematic parameters
Definition:
ToyVariations.hxx:33
SystBoxB
Definition:
SystBoxB.hxx:10
AnaECALParticleB::EMEnergy
Float_t EMEnergy
Definition:
BaseDataClasses.hxx:492
AnaTrackB::ECALSegments
AnaECALParticleB * ECALSegments[NMAXECALS]
The ECAL segments that contributed to this global track.
Definition:
BaseDataClasses.hxx:657
AnaECALParticleB
Representation of an ECAL segment of a global track.
Definition:
BaseDataClasses.hxx:459
SystematicBase::GetSystBox
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
Definition:
SystematicBase.cxx:64
AnaEventC
Definition:
CoreDataClasses.hxx:226
ECalEMEnergyScaleSystematics::Apply
void Apply(const ToyExperiment &toy, AnaEventC &event)
Apply the systematic.
Definition:
ECalEMEnergyScaleSystematics.cxx:7
AnaTrackB
Representation of a global track.
Definition:
BaseDataClasses.hxx:603
ToyExperiment::GetToyVariations
ToyVariations * GetToyVariations(UInt_t index) const
returns the variations for a given systematic (index)
Definition:
ToyExperiment.hxx:31
ToyExperiment
Definition:
ToyExperiment.hxx:14
SystBoxB::nRelevantRecObjects
Int_t nRelevantRecObjects
----—— Relevant rec objects and true objects for each systematic ------------—— ...
Definition:
SystBoxB.hxx:20
BinnedParams::GetBinSigmaValue
bool GetBinSigmaValue(Float_t value, Float_t &sigma)
Get only sigma.
Definition:
BinnedParams.hxx:566
Generated by
1.8.13