ATLAS Offline Software
Loading...
Searching...
No Matches
RingerPreProcessorWrapper.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5// $Id: RingerPreProcessorWrapper.h 704615 2015-10-29 18:50:12Z wsfreund $
6#ifndef RINGERSELECTORTOOLS_PROCEDURES_RINGERPREPROCESSORWRAPPER_H
7#define RINGERSELECTORTOOLS_PROCEDURES_RINGERPREPROCESSORWRAPPER_H
8
9#define RINGER_PROCEDURE_INCLUDE
11#undef RINGER_PROCEDURE_INCLUDE
12
13#include <type_traits>
14
15//#undef NDEBUG
16
20namespace Ringer {
21
26template<>
27class IRingerProcedureWrapper< PreProcessing::IPreProcessor > :
28 virtual public IRedirectMsgStream,
29 virtual public IRingerProcedureWrapperBase
30{
31 public:
35 typedef typename std::vector< IRingerProcedureWrapper* > WrapperCollection;
36
37#ifndef RINGER_STANDALONE
46 virtual void applyPreProcessing(
47 const DepVarStruct &depVar,
48 const xAOD::CaloRings *clrings,
49 const TrackPatternsHolder *trackPat,
50 std::vector<float> &transformVec) const = 0;
51
55 virtual void setRawConfCol(
56 const xAOD::RingSetConf::RawConfCollection *crRawConfCol) = 0;
57
61 virtual void getRawConfCol(
62 const xAOD::RingSetConf::RawConfCollection *&crRawConfCol) const = 0;
63
67 virtual SegmentationType getSegType() const = 0;
68#endif
69
76 virtual void applyPreProcessing(
77 const DepVarStruct &depVar,
78 std::vector<float> &transformVec) const = 0;
79
83 virtual const char* name() const final override {
84 return wrapName;
85 }
86
90 static void writeCol(const WrapperCollection &ppWrapperCol,
91 TDirectory *configDir);
92
97 static void read(WrapperCollection &ppWrapperCol,
98 TDirectory *configDir,
99 unsigned version);
100
101 static constexpr const char* wrapName = "RingerPreProcessorWrapper";
102
104 virtual ~IRingerProcedureWrapper(){;}
105
106 protected:
107 IRingerProcedureWrapper(){;}
108
109};
110
114typedef IRingerProcedureWrapper< PreProcessing::IPreProcessor > IPreProcWrapper;
118typedef IPreProcWrapper::WrapperCollection IPreProcWrapperCollection;
119
124template < class procedure_t,
125 /*EtaDependency*/int etaDependency,
126 /*EtDependency*/int etDependency,
127 /*SegmentationType*/int segType>
129 procedure_t,
130 etaDependency,
131 etDependency,
132 segType,
133 true, // isPreProcessor
134 false, // isDiscriminator
135 false> : // isThreshold
136 public IPreProcWrapper,
137 public RedirectMsgStream
138{
139 static_assert(
140 (std::is_base_of<VariableDependency,procedure_t>::value),
141 "RingerProcedureWrapper procedure_t type must have IVariableDependecy inheritance.");
142 public:
145
150 typedef typename std::vector <
151 std::vector <
152 std::vector < procedure_t* > >
155
158
162 const PPDepProcCollection &ppDepCol):
163 m_ppCol(ppDepCol),
164 m_pp(nullptr),
165 m_rsRawConfCol(nullptr),
166 m_nRings(0)
167 {
168 checkPPCol();
169 m_pp = m_ppCol[0][0][0];
170 }
171
172
175#ifndef RINGER_STANDALONE
184 virtual void applyPreProcessing(
185 const DepVarStruct &depVar,
186 const xAOD::CaloRings *clrings,
187 const TrackPatternsHolder *trackPat,
188 std::vector<float> &transformVec) const final override;
189
190#endif
191
198 virtual void applyPreProcessing(
199 const DepVarStruct &depVar,
200 std::vector<float> &transformVec) const final override;
202
205#ifndef RINGER_STANDALONE
209 virtual void setRawConfCol(
210 const xAOD::RingSetConf::RawConfCollection *crRawConfCol) final override
211 {
212 m_rsRawConfCol = crRawConfCol;
214 }
215
219 virtual void getRawConfCol(
220 const xAOD::RingSetConf::RawConfCollection *&crRawConfCol) const final override
221 {
222 crRawConfCol = m_rsRawConfCol;
223 }
224#endif
225
229 virtual SegmentationType getSegType() const final override
230 {
231 return static_cast<SegmentationType>(segType);
232 }
233
237 virtual bool empty() const final override
238 {
239 return m_ppCol.empty();
240 }
241
245 EtaDependency etaDep() const override final
246 {
247 return static_cast<EtaDependency>(etaDependency);
248 }
249
253 EtDependency etDep() const override final
254 {
255 return static_cast<EtDependency>(etDependency);
256 }
257
261 void releaseMemory() override final;
262
263
267 virtual void setMsgStream(MsgStream *msg) const override final;
268
272 static std::string staticFullName();
273
277 std::string fullName() const override final;
278
282 void print(MSG::Level lvl = MSG::DEBUG) const override final;
283
287 void write(TDirectory *baseDir, const char *idxStr = "") const override final;
288
292 static RingerProcedureWrapper* read(TDirectory *configDir,
293 unsigned version);
295
296 private:
299
305
311 procedure_t *m_pp;
312
313#ifndef RINGER_STANDALONE
318 unsigned m_nRings;
319#endif
321
322};
323
324} // namespace Ringer
325
326#endif // RINGERSELECTORTOOLS_PROCEDURES_RINGERPREPROCESSORWRAPPER_H
327
328#ifndef INCLUDE_HEADER_ONLY // Use to avoid circular includes
329#ifndef RINGER_DISCRIMINATOR_WRAPPER_INCLUDE
331#endif // RINGER_DISCRIMINATOR_WRAPPER_INCLUDE
332#endif // INCLUDE_HEADER_ONLY
virtual void getRawConfCol(const xAOD::RingSetConf::RawConfCollection *&crRawConfCol) const final override
Get the holden CaloRings raw configuration collection.
virtual void applyPreProcessing(const DepVarStruct &depVar, std::vector< float > &transformVec) const final override
Apply PP to transform input space into a new representation.
virtual void setMsgStream(MsgStream *msg) const override final
Overloads the setMsgStream from RedirectMsgStream.
virtual void setRawConfCol(const xAOD::RingSetConf::RawConfCollection *crRawConfCol) final override
Other utilities.
const xAOD::RingSetConf::RawConfCollection * m_rsRawConfCol
contains a pointer into the CaloRings configuration:
static RingerProcedureWrapper * read(TDirectory *configDir, unsigned version)
Read collection from TDirectory.
virtual SegmentationType getSegType() const final override
Get segmentation type for this pre-processor.
void write(TDirectory *baseDir, const char *idxStr="") const override final
Write collection to TDirectory.
std::vector< std::vector< std::vector< procedure_t * > > > PPDepProcCollection
RingerProcedureWrapper for Threshold procedures typedefs:
virtual bool empty() const final override
Returns whether holden interface collection is empty.
virtual void applyPreProcessing(const DepVarStruct &depVar, const xAOD::CaloRings *clrings, const TrackPatternsHolder *trackPat, std::vector< float > &transformVec) const final override
Main Methods:
void print(MSG::Level lvl=MSG::DEBUG) const override final
Print wrapper content.
std::vector< RawConf > RawConfCollection
typedef The raw configuration structure data holder
static unsigned totalNumberOfRings(const RawConfCollection &clRingsConf)
Get the totalNumber of Rings contained in this configuration:
Definition MsgLevel.h:28
Namespace dedicated for Ringer utilities.
EtaDependency
Specify eta position dependency.
IPreProcWrapper::WrapperCollection IPreProcWrapperCollection
Facilitate access into Threshold Wrappers collection.
IRingerProcedureWrapper< PreProcessing::IPreProcessor > IPreProcWrapper
Facilitate access into Threshold Wrappers.
EtDependency
Specify et position dependency.
SegmentationType
the possible procedure longitudinal segmentation types.
STL namespace.
CaloRings_v1 CaloRings
Definition of the current "CaloRings version".
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
#define DEBUG
Definition page_access.h:11
MsgStream & msg
Definition testRead.cxx:32
#define private