ATLAS Offline Software
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 
20 namespace Ringer {
21 
26 template<>
27 class 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
38 
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 
105 
106  protected:
108 
109 };
110 
119 
124 template < 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(
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  }
172 
175 #ifndef RINGER_STANDALONE
176 
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
206 
209  virtual void setRawConfCol(
210  const xAOD::RingSetConf::RawConfCollection *crRawConfCol) final override
211  {
212  m_rsRawConfCol = crRawConfCol;
213  m_nRings = xAOD::RingSetConf::totalNumberOfRings( *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 
303  void checkPPCol();
305 
311  procedure_t *m_pp;
312 
313 #ifndef RINGER_STANDALONE
314  const xAOD::RingSetConf::RawConfCollection *m_rsRawConfCol;
318  unsigned m_nRings;
319 #endif
320 
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
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::name
virtual const char * name() const final override
Returns this wrapper name.
Definition: RingerPreProcessorWrapper.h:83
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::getRawConfCol
virtual void getRawConfCol(const xAOD::RingSetConf::RawConfCollection *&crRawConfCol) const final override
Get the holden CaloRings raw configuration collection.
Definition: RingerPreProcessorWrapper.h:219
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::RingerProcedureWrapper
RingerProcedureWrapper(const PPDepProcCollection &ppDepCol)
Ctors:
Definition: RingerPreProcessorWrapper.h:161
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::applyPreProcessing
virtual void applyPreProcessing(const DepVarStruct &depVar, std::vector< float > &transformVec) const final override
Apply PP to transform input space into a new representation.
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::~IRingerProcedureWrapper
virtual ~IRingerProcedureWrapper()
Ensure virtual destructor.
Definition: RingerPreProcessorWrapper.h:104
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::m_nRings
unsigned m_nRings
contains the total number of rings in the vectorized representation
Definition: RingerPreProcessorWrapper.h:318
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::releaseMemory
void releaseMemory() override final
Release all holden pointer memory.
xAOD::RingSetConf_v1::RawConfCollection
std::vector< RawConf > RawConfCollection
typedef The raw configuration structure data holder
Definition: RingSetConf_v1.h:124
RingerProcedureWrapper.h
WriteCellNoiseToCool.fullName
fullName
Definition: WriteCellNoiseToCool.py:461
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::getSegType
virtual SegmentationType getSegType() const =0
Get segmentation type for this pre-processing.
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::PPDepProcCollection
std::vector< std::vector< std::vector< procedure_t * > > > PPDepProcCollection
RingerProcedureWrapper for Threshold procedures typedefs:
Definition: RingerPreProcessorWrapper.h:141
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::read
static void read(WrapperCollection &ppWrapperCol, TDirectory *configDir, unsigned version)
Read all pre-processing on configDir and append them to IPreProcWrapperCollection.
athena.value
value
Definition: athena.py:122
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::applyPreProcessing
virtual void applyPreProcessing(const DepVarStruct &depVar, const xAOD::CaloRings *clrings, const TrackPatternsHolder *trackPat, std::vector< float > &transformVec) const =0
Apply PP to transform input space into a new representation.
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::empty
virtual bool empty() const final override
Returns whether holden interface collection is empty.
Definition: RingerPreProcessorWrapper.h:237
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
Ringer::SegmentationType
SegmentationType
the possible procedure longitudinal segmentation types.
Definition: RingerSelectorToolsEnums.h:64
Ringer::IPreProcWrapperCollection
IPreProcWrapper::WrapperCollection IPreProcWrapperCollection
Facilitate access into Threshold Wrappers collection.
Definition: RingerPreProcessorWrapper.h:118
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::applyPreProcessing
virtual void applyPreProcessing(const DepVarStruct &depVar, std::vector< float > &transformVec) const =0
Apply PP to transform input space into a new representation.
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
Ringer::EtDependency
EtDependency
Specify et position dependency.
Definition: RingerSelectorToolsEnums.h:95
MSG
Definition: MsgLevel.h:28
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
xAOD::CaloRings_v1
Class summarizing the particle interaction throughout the Calorimeter (its shower shape).
Definition: CaloRings_v1.h:51
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >
Definition: RingerPreProcessorWrapper.h:30
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::etDep
EtDependency etDep() const override final
Returns et dependecy for this wrapper.
Definition: RingerPreProcessorWrapper.h:253
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
Ringer::EtaDependency
EtaDependency
Specify eta position dependency.
Definition: RingerSelectorToolsEnums.h:81
Ringer::IPreProcWrapper
IRingerProcedureWrapper< PreProcessing::IPreProcessor > IPreProcWrapper
Facilitate access into Threshold Wrappers.
Definition: RingerPreProcessorWrapper.h:114
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::etaDep
EtaDependency etaDep() const override final
Returns eta dependecy for this wrapper.
Definition: RingerPreProcessorWrapper.h:245
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::IRingerProcedureWrapper
IRingerProcedureWrapper()
Definition: RingerPreProcessorWrapper.h:107
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::applyPreProcessing
virtual void applyPreProcessing(const DepVarStruct &depVar, const xAOD::CaloRings *clrings, const TrackPatternsHolder *trackPat, std::vector< float > &transformVec) const final override
Main Methods:
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::getRawConfCol
virtual void getRawConfCol(const xAOD::RingSetConf::RawConfCollection *&crRawConfCol) const =0
Get the holden CaloRings raw configuration collection.
get_generator_info.version
version
Definition: get_generator_info.py:33
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::setRawConfCol
virtual void setRawConfCol(const xAOD::RingSetConf::RawConfCollection *crRawConfCol)=0
Set the holden CaloRings raw configuration collection.
Ringer::IRingerProcedureWrapperBase
Used as base for all IRingerProcedureWrapper template specializations.
Definition: RingerProcedureWrapper.h:74
DEBUG
#define DEBUG
Definition: page_access.h:11
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::setRawConfCol
virtual void setRawConfCol(const xAOD::RingSetConf::RawConfCollection *crRawConfCol) final override
Other utilities.
Definition: RingerPreProcessorWrapper.h:209
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
Ringer::DepVarStruct
Definition: VariableDependency.h:32
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::WrapperCollection
std::vector< IRingerProcedureWrapper * > WrapperCollection
Collection type of PreProcessor Wrappers.
Definition: RingerPreProcessorWrapper.h:35
Ringer::RingerProcedureWrapper
Specialization for Discriminator procedure.
Definition: RingerProcedureWrapper.h:171
Ringer::RingerProcedureWrapper< procedure_t, etaDependency, etDependency, segType, true, false, false >::getSegType
virtual SegmentationType getSegType() const final override
Get segmentation type for this pre-processor.
Definition: RingerPreProcessorWrapper.h:229
RingerPreProcessorWrapper.icc
xAOD::RingSetConf_v1::totalNumberOfRings
static unsigned totalNumberOfRings(const RawConfCollection &clRingsConf)
Get the totalNumber of Rings contained in this configuration:
Definition: RingSetConf_v1.cxx:227
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Ringer::IRingerProcedureWrapper< PreProcessing::IPreProcessor >::writeCol
static void writeCol(const WrapperCollection &ppWrapperCol, TDirectory *configDir)
Write all wrappers on ppWrapperCol to TDirectory.
Ringer::IRingerProcedureWrapper
Specialization for Discriminator procedure.
Definition: RingerProcedureWrapper.h:140
Ringer
Namespace dedicated for Ringer utilities.
Definition: CaloRingsDefs.h:9