HighLAND
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TPCFGDMatchEffSystematics Class Reference
Inheritance diagram for TPCFGDMatchEffSystematics:
EventWeightBase BinnedParams SystematicBase

Public Member Functions

 TPCFGDMatchEffSystematics (bool computecounters=false)
 
Weight_h ComputeWeight (const ToyExperiment &, const AnaEventC &, const ToyBoxB &)
 Apply the systematic.
 
Weight_h ComputeWeight (const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box, const SelectionBase &sel)
 This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled. More...
 
- Public Member Functions inherited from EventWeightBase
 EventWeightBase ()
 Create the systematic, with one parameter.
 
 EventWeightBase (UInt_t npar)
 Create the systematic, specifying the number of systematic parameters.
 
virtual ~EventWeightBase ()
 Everyone should have a destructor.
 
virtual void InitializeEvent (const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
 Initialize the SystBox for this event.
 
- Public Member Functions inherited from SystematicBase
 SystematicBase ()
 Create the systematic, with one parameter.
 
 SystematicBase (UInt_t npar)
 Create the systematic, specifying the number of systematic parameters.
 
virtual ~SystematicBase ()
 Everyone should have a destructor.
 
UInt_t GetNParameters () const
 Returns the number of systematic parameters associated to this systematic.
 
void SetNParameters (int N)
 Set the number of systematic parameters associated to this systematic.
 
virtual const char * GetName () const
 Return the name of this systematic. This overrides the TObject::GetName() interface.
 
const std::string & Name () const
 Return the name of this systematic.
 
void SetName (const std::string &name)
 Set the name of this systematic.
 
Int_t GetIndex () const
 Return the index of this systematic.
 
void SetIndex (Int_t index)
 Set the index of this systematic.
 
TypeEnum Type () const
 Return the type of this systematic.
 
std::string ConvertType ()
 Return the type of this systematic.
 
void SetType (TypeEnum type)
 Set the type of this systematic.
 
PDFEnum PDF () const
 Return the PDF of this systematic.
 
std::string ConvertPDF ()
 Return the PDF of this systematic.
 
void SetPDF (PDFEnum PDF)
 Set the PDF of this systematic.
 
void SetEnabled (bool ena)
 Set the enable bit.
 
bool IsEnabled () const
 Returns the enable bit.
 
virtual void FinalizeEvent (const AnaEventC &event)
 Delete the SystBox for this event.
 
SystBoxBGetSystBox (const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
 Get the SystBox corresponding to a selection, branch and event.
 
virtual void Initialize (Int_t nsel, Int_t isel, Int_t nbranch, Int_t nevents)
 Create the array of SystBox.
 
 ClassDef (SystematicBase, 2)
 
- Public Member Functions inherited from BinnedParams
 BinnedParams (const std::string &folder_name, const std::string &name, TypeEnum type, const std::string &extension="", bool useInterpolation=false)
 Constructor provided the folder name, name and the type.
 
 BinnedParams (const std::string &name, TypeEnum type, const std::string &extension="", bool useInterpolation=false)
 Constructor provided the name and the type, this is to make current psycheSystematics work, may remove it.
 
void AddBin (Float_t min, Float_t max, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin for a 1D source.
 
void AddBin (Float_t min, Float_t max, Float_t mean, Float_t sigma)
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin for a 2D source.
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t mean, Float_t sigma)
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin for a 3D source.
 
void AddBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t mean, Float_t sigma)
 
void AddGraphBin (Float_t min, Float_t max, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin graph for a 1D source.
 
void AddGraphBin (Float_t min, Float_t max, Float_t mean, Float_t sigma)
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin graph for a 2D source.
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t mean, Float_t sigma)
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t meanREAL, Float_t meanMC, Float_t sigmaMCl, Float_t sigmaMCh, Float_t meanDATA, Float_t sigmaDATAl, Float_t sigmaDATAh)
 Add a new bin graph for a 3D source.
 
void AddGraphBin (Float_t min, Float_t max, Float_t min2, Float_t max2, Float_t min3, Float_t max3, Float_t mean, Float_t sigma)
 
bool GetGraphBin (Float_t value, BinnedParamsGraphBin *&bin)
 Gets the bin for a 2D source.
 
bool GetGraphBin (Float_t value1, Float_t value2, BinnedParamsGraphBin *&bin)
 Gets the bin for a 3D source.
 
bool GetBin (Float_t value, BinnedParamsBin *&bin)
 Gets the bin for a 1D source.
 
bool GetBin (Float_t value1, Float_t value2, BinnedParamsBin *&bin)
 Gets the bin for a 2D source.
 
bool GetBin (Float_t value1, Float_t value2, Float_t value3, BinnedParamsBin *&bin)
 Gets the bin for a 3D source.
 
bool GetBinIndex (Float_t value, Int_t &index)
 Gets the bin index for a 1D source.
 
bool GetParametersForBin (Int_t index, Float_t &mean, Float_t &sigma)
 Gets the bin values for a source provided the bin index.
 
bool GetParametersForBin (Int_t index, BinnedParamsParams &params)
 
bool GetSigmaValueForBin (Int_t index, Float_t &sigma)
 Get only mean or sigma.
 
bool GetMeanValueForBin (Int_t index, Float_t &mean)
 
bool GetBinValues (Float_t value, Float_t &mean, Float_t &sigma)
 Gets the bin values for a 1D source.
 
bool GetBinValues (Float_t value, Float_t &mean, Float_t &sigma, Int_t &index)
 
bool GetBinSigmaValue (Float_t value, Float_t &sigma)
 Get only sigma.
 
bool GetBinSigmaValue (Float_t value, Float_t &sigma, Int_t &index)
 
bool GetBinMeanValue (Float_t value, Float_t &mean)
 
bool GetBinMeanValue (Float_t value, Float_t &mean, Int_t &index)
 
bool GetBinValues (Float_t value, BinnedParamsParams &params)
 
bool GetBinValues (Float_t value, BinnedParamsParams &params, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t &mean, Float_t &sigma)
 Gets the bin values for a 2D source.
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t &mean, Float_t &sigma, Int_t &index)
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t &sigma)
 Get only sigma.
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t &sigma, Int_t &index)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t &mean)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t &mean, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, BinnedParamsParams &params)
 
bool GetBinValues (Float_t value1, Float_t value2, BinnedParamsParams &params, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, Float_t &mean, Float_t &sigma)
 Gets the bin values for a 3D source.
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, Float_t &mean, Float_t &sigma, Int_t &index)
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t value3, Float_t &sigma)
 Get only sigma.
 
bool GetBinSigmaValue (Float_t value1, Float_t value2, Float_t value3, Float_t &sigma, Int_t &index)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t value3, Float_t &mean)
 
bool GetBinMeanValue (Float_t value1, Float_t value2, Float_t value3, Float_t &mean, Int_t &index)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, BinnedParamsParams &params)
 
bool GetBinValues (Float_t value1, Float_t value2, Float_t value3, BinnedParamsParams &params, Int_t &index)
 
bool GetInterBinValues (Float_t value1, BinnedParamsParams &params)
 Get values using interpolation.
 
bool GetInterBinValues (Float_t value1, Float_t value2, BinnedParamsParams &params)
 Gets the bin values for a 2D source.
 
bool GetInterBinValues (Float_t value1, Float_t value2, Float_t value3, BinnedParamsParams &params)
 Gets the bin values for a 3D source.
 
void SetType (TypeEnum type)
 Set the type.
 
void SetName (const std::string &name)
 Set the name.
 
void SetInterpolationUsage (bool use)
 Set the name.
 
const std::string & GetDataName ()
 Get the name of the source.
 
TypeEnum GetDataType ()
 Returns the type of the data.
 
bool GetInterpolationStatus ()
 Returns the type of the data.
 
void Print ()
 Dump into the screen the systematic source values.
 
void Read (const std::string &inputDirName, const std::string &extension="")
 Read from a file the systematic source values.
 
Int_t GetNBins ()
 Get the number of bins.
 
bool UpdateEfficiencyCounter (Int_t index, bool correct)
 Update the efficiency variables _ncorrect and _nwrong.
 
void InitializeEfficiencyCounter ()
 Initialize counters.
 
Int_t GetNCorrectAssoc (Int_t index)
 
Int_t GetNWrongAssoc (Int_t index)
 

Protected Member Functions

bool IsRelevantRecObject (const AnaEventC &event, const AnaRecObjectC &track) const
 Is this track relevant for this systematic ?
 
Int_t GetRelevantRecObjectGroups (const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
 Get the TrackGroup IDs array for this systematic.
 
Int_t GetRelevantTrueObjectGroups (const SelectionBase &sel, Int_t ibranch, Int_t *IDs) const
 Get the TrueTrackGroup IDs array for this systematic.
 
bool CheckTrueRecoAssociation (const AnaTrueObjectC &trueTrack, const AnaRecObjectC &track) const
 Check the true-reco association.
 
Weight_h GetWeight (const AnaFGDParticleB *FGDSegment, const ToyExperiment &toy)
 
- Protected Member Functions inherited from EventWeightBase
virtual bool IsRelevantTrueObject (const AnaEventC &, const AnaTrueObjectC &) const
 Check whether a AnaTrueObject is relevant for this systematic or not.
 
virtual void FillSystBox (const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
 Fills the SystBox.
 
void FillTrueRecoAssociation (SystBoxB &box)
 Fll the true-reco association array.
 

Protected Attributes

bool _computecounters
 
bool _apply_both_FGD1_FGD2
 
Int_t _prod6_nnodes_cut
 
- Protected Attributes inherited from SystematicBase
std::string _name
 The name of this systematic.
 
Int_t _index
 The index of this systematic (needed by SystematicsManager);.
 
TypeEnum _type
 The type of this systematic (variation, weight or flux)
 
bool _enabled
 Is this systematic enabled ?
 
PDFEnum _PDF
 The PDF use for the systematic parameter scan.
 
UInt_t _nParameters
 the number of systematic parameters
 
SystBoxB **** _systBoxes
 ----—— Relevant objects for this systematic ------------—— More...
 
Int_t _systBoxesNSel
 
Int_t _systBoxesNBranches [NMAXSELECTIONS]
 
Int_t _systBoxesNEvents [NMAXSELECTIONS][NMAXBRANCHES]
 

Additional Inherited Members

- Public Types inherited from SystematicBase
enum  TypeEnum { kVariation = 0, kWeight, kFlux, kUnknown }
 Enumerator describing the values that _type member can take.
 
enum  PDFEnum {
  kGaussian = 0, kUniform, kBinomial, kMultinomial,
  kUnknownPDF
}
 Enumerator describing the values that _PDF member can take.
 
- Public Types inherited from BinnedParams
enum  TypeEnum {
  k1D_SYMMETRIC = 0, k2D_SYMMETRIC, k3D_SYMMETRIC, k1D_SYMMETRIC_NOMEAN,
  k2D_SYMMETRIC_NOMEAN, k3D_SYMMETRIC_NOMEAN, k1D_EFF_SYMMETRIC, k2D_EFF_SYMMETRIC,
  k3D_EFF_SYMMETRIC, k1D_EFF_ASSYMMETRIC, k2D_EFF_ASSYMMETRIC, k3D_EFF_ASSYMMETRIC,
  k1D_DATA, k2D_DATA, k3D_DATA, kUnknown
}
 Enumerator describing the values that _type member can take.
 
enum  TypeShortEnum { k1D = 0, k2D, k3D, kUnknownShort }
 

Detailed Description

Definition at line 7 of file TPCFGDMatchEffSystematics.hxx.

Member Function Documentation

§ ComputeWeight()

Weight_h TPCFGDMatchEffSystematics::ComputeWeight ( const ToyExperiment toy,
const AnaEventC event,
const ToyBoxB box,
const SelectionBase sel 
)
virtual

This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled.

for long tracks crossing the FGD, TPC-FGD matching is working at 100% in production6 therefore we only consider for production 6 very short tracks starting at the edge of the FGD. This is the case that has not been taken into account with the TPC-FGD matching package which use through-going muons crossing TPC1 and TPC2 or TPC2 and TPC3.

for very short tracks in the FGD starting at the edge, tpc-fgd matching will depend on the efficiency to really get a hit in one of the two layers under consideration. Therefore the following propagation.

NHITS assume we observe nhits in the reco tracks. 1) we have the possibility that there were really nhits before (we did not lose anything: probability is :p = eff^nhits 2) we have the possibility that one hit is lost, so there nhits+1 before probability is :p= (nhits+1)*eff^nhits*(1-eff) 3) we lost 2 hits, so there were nhits+2 before probability is :p= (nhits+2)*(nhits+1)/2*eff^nhits*(1-eff)^2 sum p= eff^nhits*[1+(nhits+1)*(1-eff)+(nhits+2)*(nhits+1)/2*(1-eff)^2] = eff^nhits*[1+(nhhits+1)(1-eff)[1+(nhits+2)/2*(1-eff)]]

Reimplemented from EventWeightBase.

Definition at line 31 of file TPCFGDMatchEffSystematics.cxx.

31  {
32 //********************************************************************
33 
34  if(_computecounters)
36 
37  // Get the SystBox for this event, and the appropriate selection and branch
39 
40 #ifdef DEBUG
41  std::cout << " TPCFGDMatchEffSystematics::ComputeWeight() " << std::endl;
42  std::cout << " Event " << static_cast<const AnaEventB&>(event).EventInfo.Event << std::endl;
43 #endif
44 
45  Weight_h eventWeight=1;
46 
47  if( !versionUtils::prod6_systematics){
48  // Loop over all charged trajectories traversing TPC or FGD
49  for (Int_t itrue=0;itrue<SystBox->nRelevantTrueObjects;itrue++){
50  AnaTrueParticleB* trueTrack = static_cast<AnaTrueParticleB*>(SystBox->RelevantTrueObjects[itrue]);
51 
52  AnaTrackB* recoTrack = static_cast<AnaTrackB*>(SystBox->RelevantTrueObjectsReco[itrue]);
53  bool tpc_rec_exists=false;
54 
55  // Use by default the true momentum
56  Float_t p0 = trueTrack->Momentum;
57  if (recoTrack) p0 = recoTrack->Momentum;
58 
59  // Retrieve the systematic
60  BinnedParamsParams params;
61  Int_t index;
62  if (!GetBinValues(p0,params,index)) continue;
63 
64  //here the big inefficiency that is observed in MC and in Data is not trusted.
65  //Because the values jump from 0.7 to 0.98 from one bin to the other,
66  //we decided to interpolate the inefficiency linearly to the next bin.
67  if(p0<100 ){
68  BinnedParamsParams params1;
69  GetParametersForBin(1,params1);
70  Float_t mMCANA = params.meanMCANA + p0/100*(params1.meanMCANA - params.meanMCANA);
71  Float_t mMC = params.meanMC + p0/100*(params1.meanMC - params.meanMC);
72  Float_t mDATA = params.meanDATA + p0/100*(params1.meanDATA - params.meanDATA);
73  Float_t sigMCl = params1.sigmaMCl + (100-p0)/100.*params.sigmaMCl;
74  Float_t sigMCh = params1.sigmaMCh + (100-p0)/100.*params.sigmaMCh;
75  Float_t sigDATAl = params1.sigmaDATAl + (100-p0)/100.*params.sigmaDATAl;
76  Float_t sigDATAh = params1.sigmaDATAh + (100-p0)/100.*params.sigmaDATAh;
77  params.meanMCANA = mMCANA;
78  params.meanMC = mMC;
79  params.meanDATA = mDATA;
80  params.sigmaMCl = sigMCl;
81  params.sigmaMCh = sigMCh;
82  params.sigmaDATAl = sigDATAl;
83  params.sigmaDATAh = sigDATAh;
84  }
85 
86  // Efficiency weight when a complete TPC-FGD track exists
87  bool found=false;
88  if(recoTrack) found=true;
89  // else if(tpc_rec_exists || inFGDTPCseg) found=false;
90  else if(tpc_rec_exists) found=false;
91  else continue;
92 
93  eventWeight *= systUtils::ComputeEffLikeWeight(found, toy, GetIndex(), index, params);
94 
95  if(_computecounters)
96  UpdateEfficiencyCounter(index,found);
97  }
98  }
99  else{
100  /// for long tracks crossing the FGD, TPC-FGD matching is working at 100% in production6 therefore we only consider for production 6 very short tracks starting at the edge of the FGD. This is the case that has not been taken into account with the TPC-FGD matching package which use through-going muons crossing TPC1 and TPC2 or TPC2 and TPC3.
101  /// for very short tracks in the FGD starting at the edge, tpc-fgd matching will depend on the efficiency to really get a hit in one of the two layers under consideration. Therefore the following propagation.
102  ////// NHITS
103  /// assume we observe nhits in the reco tracks.
104  /// 1) we have the possibility that there were really nhits before (we did not lose anything:
105  /// probability is :p = eff^nhits
106  /// 2) we have the possibility that one hit is lost, so there nhits+1 before
107  /// probability is :p= (nhits+1)*eff^nhits*(1-eff)
108  /// 3) we lost 2 hits, so there were nhits+2 before
109  /// probability is :p= (nhits+2)*(nhits+1)/2*eff^nhits*(1-eff)^2
110  /// sum p= eff^nhits*[1+(nhits+1)*(1-eff)+(nhits+2)*(nhits+1)/2*(1-eff)^2]
111  /// = eff^nhits*[1+(nhhits+1)(1-eff)[1+(nhits+2)/2*(1-eff)]]
112 
113  //if( SystBox->nRelevantRecObjects == 0 ) return eventWeight;
114  // Loop over relevant tracks for this systematic
115 
116  for (Int_t itrk = 0; itrk < SystBox->nRelevantRecObjects; itrk++){
117  AnaTrackB* track = static_cast<AnaTrackB*>(SystBox->RelevantRecObjects[itrk]);
118 
119 #ifdef DEBUG
120  std::cout << " Track " << itrk << std::endl;
121 #endif
122 
123  if (!track) continue;
124 
125  // For example in numuCC inclusive selection, only the Candidate is important at first order
126  if (!sel.IsRelevantRecObjectForSystematicInToy(event, box, track, SystId::kTpcFgdMatchEff, box.SuccessfulBranch)) continue;
127 
128 
129  AnaParticleB* FGD1Segment = NULL;
130  AnaParticleB* FGD2Segment = NULL;
131 
132  bool isInFGD1 = anaUtils::InFiducialVolume(SubDetId::kFGD1, track->PositionStart);
133  bool isInFGD2 = anaUtils::InFiducialVolume(SubDetId::kFGD2, track->PositionStart);
134 
135  if (!isInFGD1 && !isInFGD2) return false;
136 
137  if (isInFGD1 || _apply_both_FGD1_FGD2){
138  FGD1Segment = anaUtils::GetSegmentWithMostNodesInDet(*track, SubDetId::kFGD1);
139  }
140 
141  if (isInFGD2 || _apply_both_FGD1_FGD2){
142  FGD2Segment = anaUtils::GetSegmentWithMostNodesInDet(*track, SubDetId::kFGD2);
143  }
144 
145  if (!FGD1Segment && !FGD2Segment) continue;
146 
147  // Primary candidate
148  AnaParticleB* prim_cand = isInFGD1 ? FGD1Segment : FGD2Segment;
149  // Secondary candidate
150  AnaParticleB* sec_cand = isInFGD1 ? FGD2Segment : FGD1Segment;
151 
152  eventWeight *= GetWeight(static_cast<AnaFGDParticleB*>(prim_cand), toy);
153 
154 #ifdef DEBUG
155  Weight_h weight_tmp = GetWeight(static_cast<AnaFGDParticleB*>(prim_cand), toy);
156  std::cout << "weight prim corr " << weight_tmp.Correction << " syst " << weight_tmp.Systematic << std::endl;
157 #endif
158  if (_apply_both_FGD1_FGD2){
159 #ifdef DEBUG
160  std::cout << " applying second weight " << std::endl;
161  if (sec_cand){
162  std::cout << " FGD " << SubDetId::GetSubdetectorEnum(sec_cand->Detector) <<std::endl;
163  }
164  else
165  std::cout << "does not exist " << std::endl;
166 #endif
167  eventWeight *= GetWeight(static_cast<AnaFGDParticleB*>(sec_cand), toy);
168 
169 #ifdef DEBUG
170  Weight_h weight_tmp = GetWeight(static_cast<AnaFGDParticleB*>(sec_cand), toy);
171  std::cout << "weight second corr " << weight_tmp.Correction << " syst " << weight_tmp.Systematic << std::endl;
172 #endif
173 
174 
175  }
176  }
177  }
178 
179 #ifdef DEBUG
180  std::cout << "weight final event corr " << eventWeight.Correction << " syst " << eventWeight.Systematic << std::endl;
181 #endif
182 
183  return eventWeight;
184 }
Float_t PositionStart[4]
The reconstructed start position of the particle.
unsigned long Detector
Int_t GetIndex() const
Return the index of this systematic.
Int_t SelectionEnabledIndex
The enabled index of this selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:49
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
Weight_h GetWeight(const AnaFGDParticleB *FGDSegment, const ToyExperiment &toy)
Float_t Momentum
The initial momentum of the true particle.
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
Float_t meanDATA
The mean value for each of the systematic parameters of the control sample.
bool UpdateEfficiencyCounter(Int_t index, bool correct)
Update the efficiency variables _ncorrect and _nwrong.
Float_t Momentum
The reconstructed momentum of the particle, at the start position.
Representation of a true Monte Carlo trajectory/particle.
virtual bool IsRelevantRecObjectForSystematicInToy(const AnaEventC &, const ToyBoxB &, AnaRecObjectC *, SystId_h syst_index, Int_t branch=0) const
Is this track relevant for a given systematic (after selection, called for each toy) ...
Int_t SuccessfulBranch
The branch that is successful for this toy in the selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:46
Float_t meanMC
The mean value for each of the systematic parameters of the control sample.
Representation of a global track.
Int_t nRelevantTrueObjects
Array of Relevant True RecObjects for each systematic.
Definition: SystBoxB.hxx:24
static SubDetId::SubDetEnum GetSubdetectorEnum(unsigned long BitField)
Get the single subdetector that this track is from.
Definition: SubDetId.cxx:165
AnaRecObjectC ** RelevantTrueObjectsReco
Definition: SystBoxB.hxx:29
Float_t meanMCANA
The mean value for each of the systematic parameters of the analysis sample.
Float_t sigmaDATAl
The sigma value for each of the systematic parameters of the control sample /// with possibility of a...
Int_t nRelevantRecObjects
----—— Relevant rec objects and true objects for each systematic ------------—— ...
Definition: SystBoxB.hxx:20
void InitializeEfficiencyCounter()
Initialize counters.
bool GetParametersForBin(Int_t index, Float_t &mean, Float_t &sigma)
Gets the bin values for a source provided the bin index.
bool InFiducialVolume(SubDetId::SubDetEnum det, const Float_t *pos, const Float_t *FVdefmin, const Float_t *FVdefmax)
AnaParticleB * GetSegmentWithMostNodesInDet(const AnaTrackB &track, SubDetId::SubDetEnum det)
Method to get the subtrack with most nodes in a given detector.
Representation of a reconstructed particle (track or shower).

§ GetWeight()

Weight_h TPCFGDMatchEffSystematics::GetWeight ( const AnaFGDParticleB FGDSegment,
const ToyExperiment toy 
)
protected

Utility to utilize for several FGD objects if needed Get the weight given an FGD segment: prod-6

Definition at line 186 of file TPCFGDMatchEffSystematics.cxx.

186  {
187 //**************************************************
188 
189  Weight_h weight;
190  if (!FGDSegment) return weight;
191 
192  Float_t nn = FGDSegment->NNodes;
193 
194  // Do nothing if nnodes above the cut
195  if (nn > _prod6_nnodes_cut) return weight;
196 
197  int fgdnum = 0;
198 
199  if (SubDetId::GetSubdetectorEnum(FGDSegment->Detector) == SubDetId::kFGD1)
200  fgdnum = 1;
201  else if (SubDetId::GetSubdetectorEnum(FGDSegment->Detector) == SubDetId::kFGD2)
202  fgdnum = 2;
203 
204  // Read the systematic source parameters
205  BinnedParamsParams params;
206  int index;
207 
208  if (!GetBinValues(fgdnum, params, index)) return weight;
209 
210  Weight_h eff_w = systUtils::ComputeEffLikeWeight(true, toy, GetIndex(), 0, params);
211 
212  Float_t Pnom = params.meanMCANA;
213 
214  Weight_h Pineff = 1-eff_w; //this is true, only if assume that effMC=1
215 
216  weight *= Weight_h(TMath::Power(eff_w.Correction,nn)*(1.+(nn+1)*(Pineff.Correction)*(((nn+2)/2.)*Pineff.Correction) )/ (1.+(nn+1)*(1-Pnom)*((nn+2)/2.*(1-Pnom))),
217  TMath::Power(eff_w.Systematic,nn)*(1.+(nn+1)*(Pineff.Systematic)*(((nn+2)/2.)*Pineff.Systematic) )/ (1.+(nn+1)*(1-Pnom)*((nn+2)/2.*(1-Pnom))));
218 
219 
220  // std::cout<<" eff_w "<<eff_w<<" effmc "<<params.meanMC<<" effdata "<<params.meanDATA<< std::endl;
221  // std::cout<<" nnodes "<<nnodes<<" pos "<<track->PositionStart[2]<<" truepos "<<track->GetTrueParticle()->Position[2]<<" weight "<<eventWeight<<std::endl;
222 
223 
224 
225 
226  return weight;
227 
228 }
unsigned long Detector
Int_t GetIndex() const
Return the index of this systematic.
Int_t NNodes
The number of nodes in the reconstructed object.
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
static SubDetId::SubDetEnum GetSubdetectorEnum(unsigned long BitField)
Get the single subdetector that this track is from.
Definition: SubDetId.cxx:165
Float_t meanMCANA
The mean value for each of the systematic parameters of the analysis sample.

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