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

Public Member Functions

 FGDHybridTrackEffSystematics (bool computecounters=false)
 
Weight_h ComputeWeight (const ToyExperiment &toy, const AnaEventC &event, const ToyBoxB &box)
 
- 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.
 
virtual 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.
 
- 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 Attributes

BinnedParams_fgd1
 
BinnedParams_fgd2
 

Protected Member Functions

bool IsRelevantTrueObject (const AnaEventC &event, const AnaTrueObjectC &trueTrack) const
 Is this true 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.
 
- Protected Member Functions inherited from EventWeightBase
virtual bool IsRelevantRecObject (const AnaEventC &, const AnaRecObjectC &) const
 Check whether a AnaRecObject is relevant for this systematic or not.
 
virtual void FillSystBox (const AnaEventC &event, const SelectionBase &sel, Int_t ibranch)
 Fills the SystBox.
 
virtual bool CheckTrueRecoAssociation (const AnaTrueObjectC &trueRecObject, const AnaRecObjectC &track) const
 Criteria for true-reco association for this systematic.
 
void FillTrueRecoAssociation (SystBoxB &box)
 Fll the true-reco association array.
 

Protected Attributes

bool _computecounters
 
- 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.
 

Detailed Description

Definition at line 8 of file FGDHybridTrackEffSystematics.hxx.

Member Function Documentation

§ ComputeWeight()

Weight_h FGDHybridTrackEffSystematics::ComputeWeight ( const ToyExperiment toy,
const AnaEventC event,
const ToyBoxB box 
)
virtual

This is now the actual method called by SystematicManager, which allows further selection tunning of relevant objects once the ToyBox is filled This MUST be overridden in the derived class.

Implements EventWeightBase.

Definition at line 26 of file FGDHybridTrackEffSystematics.cxx.

26  {
27 //********************************************************************
28 
29  Weight_h eventWeight=1;
30  BinnedParamsParams params;
31 
32  // Cast the ToyBox to the appropriate type
33  const ToyBoxTracker& box = *static_cast<const ToyBoxTracker*>(&boxB);
34 
35  // Get the SystBox for this event, and the appropriate selection and branch
37 
38  if(_computecounters){
41  }
42  // Get the direction of the main track
43  AnaTrackB *maintrack = box.MainTrack;
44  if(!maintrack) return eventWeight;
45 
46  for (Int_t itrue=0;itrue< SystBox->nRelevantTrueObjects; itrue++){
47  AnaTrueParticleB* trueTrack = static_cast<AnaTrueParticleB*>(SystBox->RelevantTrueObjects[itrue]);
48 
49  // TODO by now the reco track associated to the true is the first one found, we should use instead a criteria to decide.
50  // by now since it's very rare it's like that.
51  // retrieve the reconstructed track associated
52  AnaTrackB* recoTrack = static_cast<AnaTrackB*>(SystBox->RelevantTrueObjectsReco[itrue]);
53 
54  // Get the cos (theta), where theta is the angle between the main track and the FGD track
55  Float_t costheta = 0;
56  if (recoTrack)
57  costheta = anaUtils::ScalarProduct(maintrack->DirectionStart, recoTrack->DirectionStart);
58  else
59  costheta = anaUtils::ScalarProduct(maintrack->DirectionStart, trueTrack->Direction);
60 
61  Float_t pdg=(Float_t)trueTrack->PDG;
62  bool found = (recoTrack);
63 
64  // Get the FGD tracking efficiency
65  Int_t index;
66  if(box.DetectorFV==SubDetId::kFGD1){
67  if(!_fgd1->GetBinValues(fabs(pdg),costheta, params, index)) continue;
68  // save the index of the varied parameters into the systematics box
69  if(_computecounters)
70  _fgd1->UpdateEfficiencyCounter(index,found);
71  }
72  else if(box.DetectorFV==SubDetId::kFGD2){
73  if(!_fgd2->GetBinValues(fabs(pdg),costheta, params, index)) continue;
74  if(_computecounters)
75  _fgd2->UpdateEfficiencyCounter(index,found);
76 
77  }
78  else return eventWeight;
79 
80  eventWeight *= systUtils::ComputeEffLikeWeight(true, toy, GetIndex(), index, params);
81  }
82 
83  return eventWeight;
84 
85 }
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
SubDetId_h DetectorFV
Indicate the FV we are interested in.
Definition: ToyBoxB.hxx:52
SystBoxB * GetSystBox(const AnaEventC &event, Int_t isel=0, Int_t ibranch=0) const
Get the SystBox corresponding to a selection, branch and event.
AnaTrackB * MainTrack
For storing the Main Track (The lepton candidate in geranal: HMN or HMP track)
bool GetBinValues(Float_t value, Float_t &mean, Float_t &sigma)
Gets the bin values for a 1D source.
bool UpdateEfficiencyCounter(Int_t index, bool correct)
Update the efficiency variables _ncorrect and _nwrong.
Representation of a true Monte Carlo trajectory/particle.
Int_t SuccessfulBranch
The branch that is successful for this toy in the selection this ToyBox belongs to.
Definition: ToyBoxB.hxx:46
Int_t PDG
The PDG code of this particle.
Representation of a global track.
Int_t nRelevantTrueObjects
Array of Relevant True RecObjects for each systematic.
Definition: SystBoxB.hxx:24
Float_t DirectionStart[3]
The reconstructed start direction of the particle.
AnaRecObjectC ** RelevantTrueObjectsReco
Definition: SystBoxB.hxx:29
Float_t ScalarProduct(Float_t *array1, Float_t *array2, Int_t size=3)
Scalar product of two Float_t arrays. Provided their size.
Definition: CoreUtils.cxx:222
void InitializeEfficiencyCounter()
Initialize counters.
Float_t Direction[3]
The initial direction of the true particle.

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