MDetector/Counter.cc
Go to the documentation of this file.
1 #include <mdet/Counter.h>
2 
3 #include <sdet/Station.h>
4 #include <sdet/SDetector.h>
5 #include <utl/ErrorLogger.h>
6 #include <mdet/MHierarchyInfo.h>
7 
8 
9 namespace mdet {
10 
11  const char* const
13 
14  const char* const
16 
17  Counter::Counter(int cId) :
19  det::MPositionable<Counter>(*this),
20  fModulesUpdated(false),
21  fInvalidateData(false), // dummy value so as the get the flag initialized.
22  fInvalidateComponents(false), // idem.
23  fUseInvalidateFlags(false), // don't use these last two values so far.
24  fModules(*this)
25  {
26  /*
27  * Avoid triggering all the loading because of the simple
28  * creation of the counter.
29  * fModules.Update(GetIdsMap());
30  *
31  * When this was commented out here, the fModulesFlag
32  * was introduced.
33  */
34  Segmentation();
36  fDense = det::Detector::GetInstance().GetSDetector().GetStation(GetAssociatedTankId()).IsDense();
37  }
38 
39  int
41  const
42  {
43  return GetData(fAssociatedTankId, "associatedTankId");
44  }
45 
46  const sdet::Station&
48  const
49  {
50  int i = GetAssociatedTankId();
51  return det::Detector::GetInstance().GetSDetector().GetStation(i);
52  }
53 
56  const
57  {
59  }
60 
61  void
62  Counter::Update(bool invalidateData, bool invalidateComponents)
63  {
64  MDetectorComponent<Counter>::Type::Update(invalidateData, invalidateComponents);
65  fModulesUpdated = false; // reset flag to perform again the update.
66  // Keep track of these variables as to honor them in delayed update.
67  fInvalidateData = invalidateData;
68  fInvalidateComponents = invalidateComponents;
69  fUseInvalidateFlags = true;
70  }
71 
72  double
74  const
75  {
76  double area = 0;
77 
79  area += mod->GetArea();
80  }
81 
82  return area;
83  }
84 
85 }
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
The reference is the local coordinate system of the associated sdet::Station.
Detector description interface for Station-related data.
bool fModulesUpdated
Lazy update flag.
utl::Validated< int > fAssociatedTankId
static const char *const kComponentsNames[13]
Defines within it the common (templated) type for muon detector hierarchy components.
void Update(std::vector< double > &init, const std::vector< double > &res)
Definition: Util.h:100
static const char *const kComponentsIds[13]
ModuleConstIterator ModulesEnd() const
Begin iterator for the Modules contained in the Counter.
void Register(utl::VValidated &v)
Register the field so as to allow handling it.
T & GetData(P< T > &d, const std::string &p) const
Common utility function for configuration.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
double GetArea() const
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger reference system centered on the tank.
void Update(bool invalidateData, bool invalidateComponents)
Perform update in this component and forward to subcomponents.
int GetAssociatedTankId() const
Retrieve the id of the associated surface tank.
static const char *const kComponentName
Root detector of the muon detector hierarchy.
static const char *const kComponentId
ModuleConstIterator ModulesBegin() const
Begin iterator for the Modules contained in the Counter.
const sdet::Station & GetAssociatedTank() const
Retrieve the associated tank.
ModuleGroup::ConstIterator ModuleConstIterator
Convenience typedef for const iterator over the contained Module instances.
Counter(int cId)
Contructs a Counter with the given id.
double mod(const double d, const double periode)
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33

, generated on Tue Sep 26 2023.