ATLAS Offline Software
TTileTripReader.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * File: TTileTripReader.h
7  * Author: Stephen Cole <stephen.cole@cern.ch>
8  *
9  * Created on August 7, 2012, 4:21 PM
10  */
11 
12 #ifndef TTILETRIPREADER_H
13 #define TTILETRIPREADER_H
14 
15 #include <vector>
16 #include <map>
17 #include <iostream>
18 #include <iosfwd>
19 
20 #ifndef ROOTCORE
21 #include "PATCore/AcceptData.h"
22 #include "PATCore/AcceptInfo.h"
23 #endif /*ROOTCORE*/
24 
25 
26 class TTree;
27 
28 
29 
30 struct TripRegion{
31  double eta1;
32  double eta2;
33  double phi1;
34  double phi2;
35 };
36 
37 
38 namespace Root{
39 
41 {
42 public:
43  enum Verbosity{
45  Debug=1
46  };
47 
48  TTileTripReader(const char* name="TTileTripReader" );
49  virtual ~TTileTripReader();
50 
51  TTileTripReader(const TTileTripReader&) = delete;
53 
55  inline const char* getName() const { return m_name.c_str(); };
56 
58  {
59  return m_accept;
60  }
61 
62 #ifndef ROOTCORE
63 
76  asg::AcceptData accept(int run,int lbn, unsigned int event=0,double eta=-99.9,double phi=-99.9, int tileError=0, int tileFlags=0);
77 #endif /*ROOTCORE*/
78 
88  double areaTripFraction(int run, int lbn, double eta, double phi, double dR);
89 
90 #ifndef ROOTCORE
91 
102  float calculate(int run, int lbn, double eta, double phi, double dR, int tileError=0, int tileFlags=0);
103 #endif /*ROOTCORE*/
104 
105 
114  bool checkEtaPhi(int run,int lbn,double eta,double phi);
115 
125  bool checkEvent(unsigned int run,unsigned int lbn,unsigned int event);
126 
137  bool checkExtendedEtaPhi(int run,int lbn,double eta,double phi,double delEta,double delPhi);
138 
139  inline int finalize() { return 1; }
140 
148  std::vector<TripRegion> getEtaPhi(int run, int lbn, bool force=false);
149 
150  int initialize();
151 
156  void memLoadTripFile();
157 
165 
176  void readTileFlags(int run, int lbn, int tileError, int tileFlags);
177 
186  int setTripFile(const char* file);
187 
188  void setVerbosity(int v=Debug,std::ostream& stream=std::cout){
189  m_verbosity=v;
190  m_msglog=&stream;
191  }
192 
195 private:
199  void buildOffsets();
200 
206  int findStartEntry(int run);
207 
211  void setBadEventList();
212 
213 
215  std::string m_name;
216 
218 
219  TTree* m_trips;
220  TTree* m_runMap;
221  int m_mapRun;
222  int m_Run;
229  std::map<unsigned int,std::map<unsigned short,unsigned int> > m_badEvents;
230  std::vector<TripRegion> m_currentTrips;
231  std::vector<int> m_Offsets;
232  std::vector<char>* m_Partition;
233  std::vector<char>* m_Module;
235  std::vector<int>* m_LumiEnd;
236  std::ostream* m_msglog;
238 
239 
240 };
241 }
242 
243 #endif /* TTILETRIPREADER_H */
244 
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
Root::TTileTripReader::findStartEntry
int findStartEntry(int run)
Definition: TTileTripReader.cxx:250
Root::TTileTripReader::checkExtendedEtaPhi
bool checkExtendedEtaPhi(int run, int lbn, double eta, double phi, double delEta, double delPhi)
Definition: TTileTripReader.cxx:224
Root::TTileTripReader::m_accept
asg::AcceptInfo m_accept
Definition: TTileTripReader.h:217
Root::TTileTripReader::m_LumiStart
int m_LumiStart
Definition: TTileTripReader.h:234
Root::TTileTripReader::areaTripFraction
double areaTripFraction(int run, int lbn, double eta, double phi, double dR)
Definition: TTileTripReader.cxx:74
Root
Definition: GoodRunsListSelectorTool.h:30
Root::TTileTripReader::m_runMap
TTree * m_runMap
Definition: TTileTripReader.h:220
calibdata.force
bool force
Definition: calibdata.py:19
Root::TTileTripReader::m_Offsets
std::vector< int > m_Offsets
Definition: TTileTripReader.h:231
Root::TTileTripReader::m_ChainsLoaded
bool m_ChainsLoaded
Definition: TTileTripReader.h:237
Root::TTileTripReader::m_LBOffsets
TripRegion m_LBOffsets
Definition: TTileTripReader.h:193
Root::TTileTripReader::m_badEvents
std::map< unsigned int, std::map< unsigned short, unsigned int > > m_badEvents
Definition: TTileTripReader.h:229
TripRegion::eta1
double eta1
Definition: TTileTripReader.h:31
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
Root::TTileTripReader::m_EBOffsets
TripRegion m_EBOffsets
Definition: TTileTripReader.h:194
TripRegion::eta2
double eta2
Definition: TTileTripReader.h:32
Root::TTileTripReader::calculate
float calculate(int run, int lbn, double eta, double phi, double dR, int tileError=0, int tileFlags=0)
Definition: TTileTripReader.cxx:99
Root::TTileTripReader::operator=
TTileTripReader & operator=(const TTileTripReader &)=delete
Root::TTileTripReader::m_trips
TTree * m_trips
Definition: TTileTripReader.h:219
Root::TTileTripReader::m_mapRun
int m_mapRun
Definition: TTileTripReader.h:221
Root::TTileTripReader::Verbosity
Verbosity
Definition: TTileTripReader.h:43
Root::TTileTripReader::m_currentLbn
int m_currentLbn
Definition: TTileTripReader.h:225
Root::TTileTripReader::checkEtaPhi
bool checkEtaPhi(int run, int lbn, double eta, double phi)
Definition: TTileTripReader.cxx:147
Root::TTileTripReader::m_LumiEnd
std::vector< int > * m_LumiEnd
Definition: TTileTripReader.h:235
maskDeadModules.mod
mod
Definition: maskDeadModules.py:36
asg::AcceptInfo
Definition: AcceptInfo.h:28
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
Root::TTileTripReader::setVerbosity
void setVerbosity(int v=Debug, std::ostream &stream=std::cout)
Definition: TTileTripReader.h:188
Root::TTileTripReader::TTileTripReader
TTileTripReader(const char *name="TTileTripReader")
Definition: TTileTripReader.cxx:28
file
TFile * file
Definition: tile_monitor.h:29
Root::TTileTripReader::getAcceptInfo
const asg::AcceptInfo & getAcceptInfo() const
Definition: TTileTripReader.h:57
Root::TTileTripReader::Debug
@ Debug
Definition: TTileTripReader.h:45
Root::TTileTripReader::memLoadTripFile
void memLoadTripFile()
closes the ability to add more trip files to the chain and loads the current TChain into memory as a ...
Definition: TTileTripReader.cxx:401
Root::TTileTripReader::getEtaPhi
std::vector< TripRegion > getEtaPhi(int run, int lbn, bool force=false)
Definition: TTileTripReader.cxx:333
run
Definition: run.py:1
Root::TTileTripReader::partModToEtaPhi
TripRegion partModToEtaPhi(int part, int mod)
Definition: TTileTripReader.cxx:437
TripRegion::phi1
double phi1
Definition: TTileTripReader.h:33
Root::TTileTripReader::m_msglog
std::ostream * m_msglog
Definition: TTileTripReader.h:236
Root::TTileTripReader::finalize
int finalize()
Definition: TTileTripReader.h:139
Root::TTileTripReader::readTileFlags
void readTileFlags(int run, int lbn, int tileError, int tileFlags)
Definition: TTileTripReader.cxx:495
Root::TTileTripReader::initialize
int initialize()
Definition: TTileTripReader.cxx:394
AcceptData.h
TripRegion::phi2
double phi2
Definition: TTileTripReader.h:34
Root::TTileTripReader::m_name
std::string m_name
The name of the class instance.
Definition: TTileTripReader.h:215
Root::TTileTripReader::m_startEntry
int m_startEntry
Definition: TTileTripReader.h:226
Root::TTileTripReader::setTripFile
int setTripFile(const char *file)
Definition: TTileTripReader.cxx:606
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Root::TTileTripReader::checkEvent
bool checkEvent(unsigned int run, unsigned int lbn, unsigned int event)
Definition: TTileTripReader.cxx:192
Root::TTileTripReader::~TTileTripReader
virtual ~TTileTripReader()
Definition: TTileTripReader.cxx:58
Root::TTileTripReader::m_Run
int m_Run
Definition: TTileTripReader.h:222
python.PyAthena.v
v
Definition: PyAthena.py:154
AcceptInfo.h
Root::TTileTripReader::m_LastTileFlags
int m_LastTileFlags
Definition: TTileTripReader.h:228
Root::TTileTripReader::m_verbosity
int m_verbosity
Definition: TTileTripReader.h:227
Root::TTileTripReader::m_currentTrips
std::vector< TripRegion > m_currentTrips
Definition: TTileTripReader.h:230
Root::TTileTripReader::setBadEventList
void setBadEventList()
Fills the bad event map.
Definition: TTileTripReader.cxx:636
Root::TTileTripReader::accept
asg::AcceptData accept(int run, int lbn, unsigned int event=0, double eta=-99.9, double phi=-99.9, int tileError=0, int tileFlags=0)
Definition: TTileTripReader.cxx:63
Root::TTileTripReader::buildOffsets
void buildOffsets()
Attempts to correct for improperly built trip list files.
Definition: TTileTripReader.cxx:104
Root::TTileTripReader::m_Partition
std::vector< char > * m_Partition
Definition: TTileTripReader.h:232
Root::TTileTripReader::getName
const char * getName() const
Get the name of the class instance.
Definition: TTileTripReader.h:55
TripRegion
Definition: TTileTripReader.h:30
Default
asg::AcceptData
Definition: AcceptData.h:30
Root::TTileTripReader::m_FirstEntry
int m_FirstEntry
Definition: TTileTripReader.h:223
Root::TTileTripReader
Definition: TTileTripReader.h:41
Root::TTileTripReader::m_Module
std::vector< char > * m_Module
Definition: TTileTripReader.h:233
Root::TTileTripReader::m_currentRun
int m_currentRun
Definition: TTileTripReader.h:224
Root::TTileTripReader::TTileTripReader
TTileTripReader(const TTileTripReader &)=delete