ATLAS Offline Software
Loading...
Searching...
No Matches
EffiCollection.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  CP
 Select isolated Photons, Electrons and Muons.

Functions

namespace ADD_CMODE (CP)

Function Documentation

◆ ADD_CMODE()

namespace ADD_CMODE ( CP )

The EffiCollection class handles the 5 different scale-factor maps binned in time. Each muon is piped to the correct map based whether it's a calo-tag muon, belongs to the high-eta region or has low-pt. There exists one instance of the EffiCollection foreach systematic variation and nominal. Scale-factor maps which are not affected by a systematic, especially in the case of common vs. low-pt, are taken from the Nominal maps.

Constructor with nominal as fallback..

return the correct SF type to provide, depending on eta and the author

The five different scale-factor maps

Bits 6-9 are already reserved for the systematic enum below

Distinguish these two because the systematics are named with an extra LOWPT

a consistency check of the scale-factor maps. All scale-factor maps must be present and there must no overlapping periods to pass this test.

Get the number of all bins in the scale-factor maps including the overflow & underflow bins

If systematic decorrelation is activated then the user needs to loop manually over the syst bins. This method activates the i-th bin to be active. For the remaining bins the nominal scale-factor is returned instead.

Checks whether the i-th bin belongs to the low-pt map...

Checks whether the i-th bin belongs to the forward map

Returns the global bin name conststucted from the axis titles and the bin borders

Returns the bin number from which the scale-factor of the muon is going to be retrieved...

Returns the systematic set affecting this collection.

Returns whether the given set has variations affecting this Collection

Method to retrieve a container from the class ordered by a collection type This method is mainly used to propagate the nominal maps to the variations as fallback maps if no variation has been defined in this situation

Make the collection container shared ptr to allow that a systematic EffiCollection can use the same container as the nominal one if the current systematic has no effect on that particular container....

The systematic set is returned back to the MuonEfficiencyScaleFactors instance to register The known systematics to the global service

The collection container manages the time binning of a particular scale-factor map. For a given runNumber, it pipes the right map to the upstream tools.

Nominal constructor... Only needs to know about it's type and the file to load

Retrieve the scale-factor map belonging to that particular run of data-taking

Checks if the global bin number belongs to this map

Consistency check of all scale-factor maps managed by the container instance

Returns MUON_EFF_<sysname()>

Activate this bin to run in the uncorrelated systematic mode

Sets the global offset to align the order in the map into a global numbering scheme

Number of bins of the map itself

Number of overflow bins in the map

Check whether the bin is overflow or not

Global offset of the bin numbers

Name of the i-th bin

Returns the global bin number corresponding to the muon kinematics. In case of failures -1 is returned

File type of the map

Offset to translate between the bin-numbers in the bin numbers of each file against the global bin-number

Definition at line 1 of file EffiCollection.h.

29 {
30 class MuonEfficiencyScaleFactors;
32 class CollectionContainer;
37 class EffiCollection final : public columnar::ColumnarTool<> {
38 public:
39 explicit EffiCollection(MuonEfficiencyScaleFactors& ref_tool);
41 EffiCollection(const EffiCollection* Nominal, MuonEfficiencyScaleFactors& ref_tool, const std::string& syst, int syst_bit_map, bool is_up);
42
44 EfficiencyScaleFactor* retrieveSF(const xAOD::Muon & mu, unsigned int RunNumber) const;
45 EfficiencyScaleFactor* retrieveSF(columnar::MuonId mu, unsigned int RunNumber) const;
46 enum CollectionType {
48 Central = 1,
49 Calo = 1<<1,
50 Forward = 1<<2,
51 CentralLowPt = 1<<3,
52 CaloLowPt = 1<<4,
54 LRTCentral = 1<<10,
55 LRTCentralLowPt = 1<<11,
56
57 ZAnalysis = Central | Calo | Forward | LRTCentral,
60 JPsiAnalysis = CentralLowPt | CaloLowPt | LRTCentralLowPt,
61
62
63 };
64 enum Systematic{
65 Symmetric = 1<<6,
66 PtDependent = 1<<7,
67 UnCorrelated = 1<<8,
68 UpVariation = 1<<9,
69 };
70 static std::string FileTypeName(EffiCollection::CollectionType T);
71
72
75 bool CheckConsistency();
76
79 unsigned int nBins() const;
80
85 bool SetSystematicBin(unsigned int Bin);
86
88 bool IsLowPtBin(unsigned int Bin) const;
90 bool IsForwardBin(unsigned int Bin) const;
91
94 std::string GetBinName(unsigned int bin) const;
95
98 int getUnCorrelatedSystBin(const xAOD::Muon& mu) const;
99
100
102 CP::SystematicSet* getSystSet() const;
104 bool isAffectedBySystematic(const CP::SystematicVariation& variation) const;
105 bool isAffectedBySystematic(const CP::SystematicSet& set) const;
106
107
111 std::shared_ptr<CollectionContainer> retrieveContainer(CollectionType Type) const;
112
113 private:
114 CollectionContainer* FindContainer(unsigned int bin) const;
115 CollectionContainer* FindContainer(columnar::MuonId mu) const;
116 CollectionContainer* FindLRTContainer(columnar::MuonId mu) const;
117
118 const MuonEfficiencyScaleFactors& m_ref_tool;
119
123 std::shared_ptr<CollectionContainer> m_central_eff;
124 std::shared_ptr<CollectionContainer> m_calo_eff;
125 std::shared_ptr<CollectionContainer> m_forward_eff;
126 std::shared_ptr<CollectionContainer> m_lowpt_central_eff;
127 std::shared_ptr<CollectionContainer> m_lowpt_calo_eff;
128 std::shared_ptr<CollectionContainer> m_lrt_central_eff;
129 std::shared_ptr<CollectionContainer> m_lrt_lowpt_central_eff;
130
133 std::unique_ptr<CP::SystematicSet> m_syst_set;
134
135 public:
136
137 columnar::MuonAccessor<columnar::ObjectColumn> m_muons {*this, "Muons"};
141 columnar::MuonAccessor<char> isLRTmuon {*this, "isLRT", {.isOptional = true}};
142 };
143
146 class CollectionContainer final {
147 public:
149 CollectionContainer(const MuonEfficiencyScaleFactors& ref_tool, EffiCollection::CollectionType FileType);
150 CollectionContainer(const MuonEfficiencyScaleFactors& ref_tool, CollectionContainer* Nominal, const std::string& syst_name, unsigned int syst_bit_map);
151
153 EfficiencyScaleFactor* retrieve(unsigned int RunNumer);
154
156 bool isBinInMap (unsigned int bin) const;
158 bool CheckConsistency();
159
161 std::string sysname() const;
162
164 bool SetSystematicBin(unsigned int Bin);
165
168 void SetGlobalOffSet(unsigned int OffSet);
169
171 unsigned int nBins() const;
173 unsigned int nOverFlowBins() const;
175 bool isOverFlowBin(int b) const;
176
177
179 unsigned int globalOffSet() const;
180
182 std::string GetBinName(unsigned int Bin) const;
183
186 int FindBinSF(const xAOD::Muon &mu) const;
187
189 EffiCollection::CollectionType type() const;
190
191 bool isNominal() const;
192 bool isUpVariation() const;
193 bool separateBinSyst() const;
194
195 private:
196 std::map<std::string, std::pair<unsigned int, unsigned int>> findPeriods(const MuonEfficiencyScaleFactors& ref_tool) const;
197 std::string fileName(const MuonEfficiencyScaleFactors& ref_tool) const;
198
199 bool LoadPeriod(unsigned int RunNumber);
200
201 std::vector<std::shared_ptr<EfficiencyScaleFactor>> m_SF;
202 EfficiencyScaleFactor* m_currentSF;
203 std::unordered_set<unsigned int> m_warnedForRunNumber;
204
205 EffiCollection::CollectionType m_FileType;
208 unsigned int m_binOffSet;
209
210 public:
211 void addSubtoolsTo (columnar::ColumnarTool<>& parentTool);
212
213 };
214
215}
RootType Type
the base class for all columnar components
ObjectId< MuonDef > MuonId
Definition MuonDef.h:22
AccessorTemplate< MuonDef, CT, ColumnAccessMode::input, CM > MuonAccessor
Definition MuonDef.h:24
Muon_v1 Muon
Reference the current persistent version:
Definition Muon.h:13