MDetector/PMT.h
Go to the documentation of this file.
1 #ifndef _mdet_PMT_h
2 #define _mdet_PMT_h
3 
4 #include <mdet/MComponentGroup.h>
5 #include <mdet/MDetectorComponent.h>
6 #include <mdet/PMT_helper.h>
7 //
8 // Boost's iterators used here require a complete type ('cause they use boost::is_pod)
9 // With GCC 4.3.3 there wasn't any compiling problem, but with 4.4.3 there was.
10 #include <mdet/Pixel.h>
11 //
12 #include <utl/ShadowPtr_fwd.h> // just forward it, to declare friendship.
13 //
14 #include <boost/iterator/indirect_iterator.hpp>
15 
16 namespace mdet {
17 
18  class Module;
19 
20  class Pixel;
21 
49  class PMT :
50  public MDetectorComponent<PMT>::Type {
51  private:
60  typedef PixelGroup::Iterator PixelIterator;
61  public:
70  static const double kCentralPixelSelfTalk;
85  static const unsigned int kNumNeighborsInside = 8;
112  static const unsigned int kNumNeighborsSide = 5;
140  static const unsigned int kNumNeighborsCorner = 3;
145  typedef PixelGroup::ConstIterator PixelConstIterator;
153  typedef std::vector<const Pixel*> NeighborsContainer;
159  typedef std::vector<double> CrossTalkContainer;
175  typedef boost::indirect_iterator<NeighborsContainer::const_iterator> NeighborConstIterator;
176 
177  static const char* const kComponentName;
178 
179  static const char* const kComponentId;
180 
185  return fPixels.Begin();
186  }
191  return fPixels.End();
192  }
212  const Pixel& ComputePulseDestination(const Pixel& src) const;
219  bool IsNeighbor(const Pixel& src, const Pixel& dst) const;
223  const Module& GetModule() const;
224  private:
229  void Update(bool invalidateData, bool invalidateComponents);
254  double GetCrossTalk(const Pixel& src, const Pixel& dst) const;
265  double GetCrossTalkProportion(const Pixel& src, const Pixel& dst) const;
271  double GetCrossTalkNormalizationFactor(const mdet::Pixel& pix) const;
288  PMT(int pId, const det::VManager::IndexMap& parentMap, const Module& parent);
292  void InitPixels();
296  ~PMT() { }
300  const PixelGroup& GetPixels() const {
301  return fPixels;
302  }
306  template<class Predicate>
307  NeighborsContainer::const_iterator IsNeighbor(const Pixel& src, const Pixel& dst, const Predicate& p) const;
311  PixelGroup::SizeType GetRows() const;
315  PixelGroup::SizeType GetCols() const;
321  friend class Module;
328  friend class utl::ShadowPtr<PMT>;
329 
331 
332  const Module& fModule;
337 
338  };
339 
340 }
341 
342 #endif // _mdet_PMT_h
343 
std::vector< double > CrossTalkContainer
Typedef for mdet::Pixel crosstalk container.
pointer with built-in initialization, deletion, deep copying
Definition: ShadowPtr.h:163
NeighborConstIterator NeighborsBegin(const Pixel &p) const
Begin iterator over neighbors of the given pixel.
Defines within it the common (templated) type for muon detector hierarchy components groups...
double GetCrossTalkNormalizationFactor(const mdet::Pixel &pix) const
Helper method to manage the conversion factor for cross-talk.
PixelGroup::ConstIterator PixelConstIterator
Convenience typedef for const iterator over the contained mdet::Pixel instances.
NeighborConstIterator NeighborsEnd(const Pixel &p) const
End iterator over neighbors of the given pixel.
static const double kCentralPixelSelfTalk
Assumed value for central pixel self-talk.
Definition: MDetector/PMT.h:70
Defines within it the common (templated) type for muon detector hierarchy components.
double GetCrossTalk(const Pixel &src, const Pixel &dst) const
Returns the cross-talk coefficient for dst seen as a neighbor of src.
void InitPixels()
Initilization and validations related to pixels.
static const char *const kComponentName
PixelGroup::Iterator PixelIterator
Non-const private alias.
Definition: MDetector/PMT.h:60
std::vector< const Pixel * > NeighborsContainer
Typedef for mdet::Pixel neighbor container.
const PixelGroup & GetPixels() const
Accesses the group of pixels.
const Module & GetModule() const
The module to which this PMT belongs.
const Pixel & ComputePulseDestination(const Pixel &src) const
Computes a destination pixel according to crosstalk effect.
static const unsigned int kNumNeighborsCorner
Number of neighbors for a pixel on the corner of the PMT&#39;s cathode. The assumed layout for the neighb...
double GetCrossTalkProportion(const Pixel &src, const Pixel &dst) const
The cross-talk proportion coefficient for dst seen as a neighbor of \ src.
static const unsigned int kNumNeighborsSide
Number of neighbors for a pixel on the side of the PMT&#39;s cathode.
const Module & fModule
Array of Scintillator.
PixelGroup::SizeType GetRows() const
Retrieves the number of rows.
Multiple-pixel photo-multiplier tube.
Definition: MDetector/PMT.h:49
PixelGroup::SizeType GetCols() const
Retrieves the number of columns.
PixelConstIterator PixelsBegin() const
Begin iterator over the contained pixels.
bool IsNeighbor(const Pixel &src, const Pixel &dst) const
Tells whether dst is one of the neighbors of src.
PixelGroup fPixels
PMT pixel.
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
void Update(bool invalidateData, bool invalidateComponents)
Perform update in this component and forward to subcomponents.
int fFirstIdPMT
Minimum id among PMT&#39;s ids.
~PMT()
Destructor (!).
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33
PMT(int pId, const det::VManager::IndexMap &parentMap, const Module &parent)
Constructs the tube.
PixelConstIterator PixelsEnd() const
End iterator over the contained pixels.
MComponentGroup< PMT, Pixel, det::ParentCreator >::Type PixelGroup
Type for the set of associated mdet::Pixel.
Definition: MDetector/PMT.h:56
static const unsigned int kNumNeighborsInside
Number of neighbors for a pixel inside (ie in the middle) the PMT&#39;s cathode.
Definition: MDetector/PMT.h:85
boost::indirect_iterator< NeighborsContainer::const_iterator > NeighborConstIterator
Convenience typedef for iteration over neighbors.
Definition: PMT_helper.h:37
static const char *const kComponentId
boost::indirect_iterator< NeighborsContainer::const_iterator > NeighborConstIterator
Convenience typedef for iteration over neighbors.

, generated on Tue Sep 26 2023.