Berkeley Nuclear Data Software
ConfigClasses.h
Go to the documentation of this file.
1 #ifndef _CONFIG_CLASSES_H_
2 #define _CONFIG_CLASSES_H_
3 
4 
5 //project
6 #include "CutClasses.h"
7 #include "CalibrationClasses.h"
8 
9 //c++
10 #include <vector>
11 #include <iostream>
12 #include <map>
13 //for MC of uncertainties
14  #include "../external/eigen/Eigen/Dense"
15 //declaration to allow friend class construction
16 // class ExperimentConfig::rebuildMap();
17 
18 
19 enum DetType
20 {
28  NA
29 };
30 
32 {
35  OTHER
36 };
40 {
41 public:
42  //default constructor puts the class into an empty but working state
44  //setters
45  void setIsotope(std::string a_isotope);
46  void setActivity(double a_activity);
47  void setEnergy(double a_energy);
48  void setX(double a_x);
49  void setY(double a_y);
50  void setZ(double a_z);
51  //getters
52  std::string getIsotope() const;
53  double getActivity() const;
54  double getEnergy() const;
55  double getX() const;
56  double getY() const;
57  double getZ() const;
58  std::vector<double> getPosVector() const;
59 private:
60  std::string m_isotope;
61  double m_activity;
62  // assumes monoenergetic, in keV
63  double m_sourceEnergy;
64  double m_x;
65  double m_y;
66  double m_z;
67 };
68 
69 
70 std::ostream& printDetType( std::ostream& a_stream , DetType a_type);
76 {
77 public:
78  DetectorInfo();
79 
80  DetType getDetType() const;
81  int getDetectorID() const;
82  double getX() const;
83  double getY() const;
84  double getZ() const;
85  double getrX() const;
86  double getrY() const;
87  double getrZ() const;
88  double getDetectorLength() const;
89 
91  double getDistance(double a_detHalfLength) const;
95  std::vector<double> getLocation(double a_stepLenght) const;
96 
97  void setDetType(DetType a_detType);
98  void setDetectorID(int a_detectorID);
99  void setX(double a_x);
100  void setY(double a_y);
101  void setZ(double a_z);
102  virtual void translate(double a_x,
103  double a_y,
104  double a_z
105  );
106  void setrX( double a_rX);
107  void setrY( double a_rY);
108  void setrZ( double a_rZ);
109 
110  void setDetectorLength( double a_detLength);
113  std::vector<double> getDetectorCenter();
118  double getScatteringAngle(double a_bx,
119  double a_by,
120  double a_bz,
121  double a_sx,
122  double a_sy,
123  double a_sz);
124 
130  double getBeamScatteringAngle(double a_bx,
131  double a_by,
132  double a_bz,
133  DetectorInfo& a_rhs
134  );
135 
139  double getSourceScatteringAngle(double a_sx,
140  double a_sy,
141  double a_sz,
142  DetectorInfo& a_rhs
143  );
147  double getDistance( float a_thisDetHalfL,
148  float a_rhsHalfL,
149  DetectorInfo& a_rhs
150  );
151  virtual std::ostream& print( std::ostream& a_stream ) const;
152 
153  virtual ~DetectorInfo();
154 protected:
157  double m_x;
158  double m_y;
159  double m_z;
160  double m_rX;
161  double m_rY;
162  double m_rZ;
164 };
165 
169 {
170 public:
173  virtual DetectorElementInfo& operator=(const DetectorElementInfo& a_rhs);
174  int getModID() const;
175  int getChannel() const;
176  DetectorCalib* getGainCalib() const;
177  DetectorCalib* getTimeCalib() const;
178  void setModID(int a_modID);
179  void setChannel(int a_channel);
180  void setGainCalib(DetectorCalib* a_gainCalib);
181  void setTimeCalib(DetectorCalib* a_timeCalib);
182  double getPolarAngle() const;
183  double getAzimuthalAngle();
184  std::ostream& print( std::ostream& a_stream ) const;
185 
186  virtual ~DetectorElementInfo();
187 protected:
188  int m_modID;
192 };
193 
197 {
198 public:
199  OrgScintInfo();
202  OrgScintInfo(const OrgScintInfo& a_rhs);
205  std::vector<double> getResParams();
206  //this breaks encapsulation and probably needs a little thought
207  CutBase* getNeutronCut() const;
208  CutBase* getGammaCut() const;
209  CutBase* getPSDCut() const;
210  CutBase* getEnCut() const;
211 
212  //Get the particle type of an event with characteristics a_X and a_Y
213  enum ParticleType getParticleType(double a_X, double a_Y) const;
214 
215  //Check if an event with characteristic a_X, a_Y is neutron
216  bool isNeutron(double a_X, double a_Y) const;
217  //Check if an event with characteristic a_X, a_Y is gamma
218  bool isGamma(double a_X, double a_Y) const;
219 
220  void setResParams(double a_EC,double a_E1,double a_E2);
221  void setNeutronCut(CutBase* a_cut);
222  void setGammaCut(CutBase* a_cut);
223  void setPSDCut(CutBase* a_cut);
224  void setEnCut(CutBase* a_cut);
225 
226  double getLightResolution(double a_energy) const;
227 
228  virtual std::ostream& print( std::ostream& a_stream ) const;
229 
230  virtual ~OrgScintInfo();
231 protected:
232  //resolution terms
233  double m_EC;
234  double m_E1;
235  double m_E2;
236  //cuts
241 };
242 
248 {
249 public:
259  void addPMTInfo(int a_PMTID,
260  OrgScintInfo& a_pmtInfo
261  );
262 
265  bool hasPMTID(int a_ID) const;
266 
267  //this funtcion checks if the mod ID and channel are present in the
268  //data structure
269  bool hasModIDCh(int a_modID,int a_ch) const;
271  int getPMTID(int a_modID,int a_ch) const;
276  const OrgScintInfo& getPMTInfo(int a_ID) const;
278  std::vector<int> getIDList() const;
281  std::vector<int> getChList() const;
282  //returns the pmt id which all additional pmt's are condisered against
283  int getTimeBaseID() const;
284 
287  double getDtCal(int a_pmtID);
288 
291  void setDtCal(int a_pmtID, double a_tc);
292 
293 
297  bool isFullSet(std::vector<int> a_chList);
298 
299  void setWallTime(uint32_t a_t);
300  void setTimeBaseID(int a_pmtID);
303  void translate(double a_x,
304  double a_y,
305  double a_z
306  );
309  virtual std::ostream& print( std::ostream& a_stream ) const;
310 
311 private:
312  //this container maps between id'd pmts and there daq inputs calibrations etc
313  std::map<int,OrgScintInfo> m_pmts;
314  std::map<int,double > m_pmtOffset;
315  int m_timeBaseID;
316 
317 
318 
319 };
323 {
324 public:
325  InorgScintInfo();
326 private:
327 };
328 
332 {
333 public:
334  HPGeInfo();
335 private:
336 };
337 
339 
340 class CloverInfo : public DetectorInfo
341 {
342 public:
343  CloverInfo();
344  //ensures a deep copy of pointer variables
345  CloverInfo(const CloverInfo& a_rhs);
346  CloverInfo& operator=(const CloverInfo& a_rhs);
347  void addLeafInfo(DetectorElementInfo a_leaf);
348  void addBGOInfo(DetectorElementInfo a_leaf);
349 
350  int getLeafNumber(int a_channel) const;
351  int getChFromLeaf(int a_leafNumber) const;
352  int getBGONumber(int a_channel) const;
353  int getChFromBGONumber(int a_BGO) const;
354  const DetectorElementInfo& getDetElInfo(int a_modID,int a_ch) const;
355  const DetectorElementInfo& getLeafInfo(int a_leafID) const;
356 
357  std::vector<int> getLeafIdList() const;
358  int getDetID() const ;
359  std::vector<int> getBGOInputs() const;
360 
361  const DetectorCalib* getCalibFromLeafID(int a_leafID) const;
362  const DetectorCalib* getCalibFromLeafCh(int a_channel) const;
363 
364  const DetectorCalib* getTCalibFromLeafCh(int a_channel) const;
365  const DetectorCalib* getTCalibFromLeafID(int a_leafID) const;
366 
367  const CutBase* getLeafTDCCut() const;
368  const CutBase* getBgoTDCCut() const;
369  const CutBase* getaddBackCut() const;
370 
371  void setLeafTDCCut(CutBase* a_cut);
372  void setBgoTDCCut(CutBase* a_cut);
373  void setAddBackEnCut(CutBase* a_cut);
374  void setWallTime(uint32_t a_t);
375  //overides base class translate to manage individual leafs
376  void translate(double a_x,
377  double a_y,
378  double a_z
379  );
381  std::vector<double> getCenterPosition();
383  std::vector<double> getLeafNormalVector(int a_leaf);
385  std::vector<double> getLeafPositionVector(int a_leaf);
387  std::vector<int> getChannels();
391  bool hasChannel(int a_ch) const ;
393  bool thisClover(int a_modID, int a_ch) const;
395  bool isLeaf(int a_modID, int a_ch) const;
397  bool isBGO(int a_modID, int a_ch) const;
399  double getLeafPolarAngle(int a_leafNumber);
401  double getLeafDistance(int a_leafNumber);
403  double getLeafDistToOrig(int a_leafNumber, double a_detLength) const;
404  bool hasBGOChannel(int a_ch) const ;
406  std::ostream& print( std::ostream& a_stream=std::cout) const;
407 
410  std::ostream& printRot(std::ostream & a_stream = std::cout) const;
411  virtual ~CloverInfo();
412 private:
413  std::vector<DetectorElementInfo> m_leafs;
414  std::vector<DetectorElementInfo> m_BGOs;
415  CutBase* m_leafTDCCut;
416  CutBase* m_bgoTDCCut;
417  CutBase* m_addBackEnCut;
418  std::vector<DetectorElementInfo>& getLeafVector();
419  std::vector<DetectorElementInfo>& getBGOVector();
420 
421  //limited exposure of encapsulated data to allow the construction of and
422  //functionalization of the mod id map in the Experiment config
423  friend class ExperimentConfig;
424 
426 };
427 
431 {
432 public:
436  ExperimentConfig(const ExperimentConfig& a_config);
438 
439  //functions used to construct the configuration
440  void addOrgScints(std::vector<OrgScintInfo> a_orgScints);
441  void addInorgScints(std::vector<InorgScintInfo> a_inorgScints);
442  void addHPGEs(std::vector<HPGeInfo> a_HPGEs);
443  void addClovers(std::vector<CloverInfo> a_clovers);
444  void addOrgScint(OrgScintInfo a_orgScint);
445  void addMultiPMTOrgScint(MultiPMTOrgScintInfo a_orgScint);
446  void addInorgScint(InorgScintInfo a_inorgScint);
447  void addHPGE(HPGeInfo a_HPGE);
448  void addClover(CloverInfo a_clover);
449  void addDetLengths(std::map<DetType,double> a_lengthMap);
450  void addSourceInfo(std::string a_id, PointSourceInfo a_source);
451  void setRFOffset(DetectorCalib* a_offset);
452  void setRFCalibID(int a_ID);
453  void setRFPeriod(double a_RFPeriod);
454  void setTDCRes(double a_TDCRes);
455  void setRFFilter(bool a_doFilter);
456  void setRFSubPeriod(uint16_t a_triggerPeriod);
459  void translateCoordinates(double a_x,
460  double a_y,
461  double a_z
462  );
464  bool isKnown(int a_modID, int a_ch) const;
465  bool isKnownModule(int a_modID) const;
467  const DetectorElementInfo& getDetElInfo(int a_modID, int a_ch) const;
469  std::ostream& printLayout( std::ostream& a_stream ) const;
470 
471  DetType getDetType(int a_modID, int a_ch) const;
472 
473  int getDetID(int a_modID, int a_ch) const;
474  const CloverInfo& getCloverInfo(int a_modID, int a_ch) const;
475  const CloverInfo& getCloverInfo(int a_clovID) const;
476  const std::vector<CloverInfo>& getCloverInfos() const;
477  const OrgScintInfo& getOrgScintInfo(int a_modID, int a_ch) const;
478  const OrgScintInfo& getOrgScintInfo(int a_orgScintID) const;
479 
481  int a_ch) const;
482  const MultiPMTOrgScintInfo& getMultiPMTOrgScintInfo(int a_orgScintID) const;
483 
484  const InorgScintInfo getInorgScintInfo(int a_modID, int a_ch) const;
485  const InorgScintInfo getInorgScintInfo(int a_inorgScintID) const;
486 
487  const HPGeInfo getHPGeInfo(int a_modID, int a_ch) const;
488  const HPGeInfo getHPGeInfo(int a_hpgeID) const;
489 
490  std::vector<int> getDetIDList(DetType a_detType) const;
491 
492  double getRFOffset() const;
493  double getRFCalibID() const;
494  double getRFPeriod() const;
495  double getTDCRes() const;
496  bool getRFFilter() const;
497  uint16_t getRFSubPeriod() const;
500  double getRFModuleID();
501  std::map<DetType, double> getDetectorLengths() const;
502  // void readExperimentParameters(std::string a_configFileName);
503 
504  void setTime(uint32_t a_t);
509  double detDistToOrig(DetType a_detType,int a_detID, int a_elementID=0) const;
510 
513  bool canDoTiming() const;
514 
517  bool canDoGainConversion() const;
518 
521  int getNumModules();
524  void clearDet(DetType a_type);
525  virtual ~ExperimentConfig();
526 protected:
527  //this function rebuild the internal map used to reference mod id and ch to
528  //detector id's
529  void rebuildMap();
530  std::vector<OrgScintInfo> m_orgScints;
531  std::vector<MultiPMTOrgScintInfo> m_PMTOrgScints;
532  std::vector<InorgScintInfo> m_inorgScints;
533  std::vector<HPGeInfo> m_HPGEs;
534  std::vector<CloverInfo> m_clovers;
535  std::map<std::string , PointSourceInfo> m_sourceInfo;
539  std::map<int , std::map<int, std::pair< DetType, int > > > m_modChMap;
541  std::map<DetType, double> m_detectorLengths;
546  //stores the rf period in ns
547  double m_RFPeriod;
548  //stores the resolution of the TDC (chan to ns)
549  double m_TDCRes;
550  //sets whether or not to use the rf filter in sorts
552  //the observed sub-period of the rf to trigger on
553  uint16_t m_rfSubPeriod;
555  // std::map<uint32_t,double> m_BCMDataMap;
556 
557  //used for safe return of default constructed const empty references
564 
565 };
566 
570 class ScintConfig : protected ExperimentConfig
571 {
572 public:
573  ScintConfig();
574  ScintConfig(const ExperimentConfig& a_obj);
593 
594 
595 
596 private:
597 };
598 
606 {
607 public:
609  int getDetectorID() const;
610  int getModID() const;
611  int getChannel() const;
612  double getXUnc() const;
613  double getYUnc() const;
614  double getZUnc() const;
615  double getEnCutMinUnc() const;
616  double getEnCutMaxUnc() const;
617 
618  Eigen::VectorXd getCalibrationAndResolution() const;
619  Eigen::MatrixXd getCalibResCovariance() const;
620 
621  void setDetectorID(int a_detectorID);
622  void setModID(int a_modID);
623  void setChannel(int a_channel);
624  void setXUnc(double a_xUnc);
625  void setYUnc(double a_yUnc);
626  void setZUnc(double a_zUnc);
627  void setLYParams(std::vector<double> a_lyParams);
628  void setLYCovMat(std::vector<double> a_lyCovMat);
629  void setEnCutMinUnc(double a_EncutUnc);
630  void setEnCutMaxUnc(double a_EncutUnc);
631 
632  protected:
634  int m_modID;
636  double m_xUnc;
637  double m_yUnc;
638  double m_zUnc;
641 
643  Eigen::VectorXd m_lyParams;
645  Eigen::MatrixXd m_lyCovariances;
646 };
647 
652 {
653 public:
658 
659  //functions used to construct the configuration
660  void addOrgScintsUnc(std::vector<OrgScintUncertaintiesInfo> a_orgScints);
661  void addOrgScintUnc(OrgScintUncertaintiesInfo a_orgScint);
663  bool isKnown(int a_modID, int a_ch) const;
664  std::ostream& printLayout( std::ostream& a_stream ) const;
665 
666  const OrgScintUncertaintiesInfo getOrgScintUncInfo(int a_modID, int a_ch) const;
667  const OrgScintUncertaintiesInfo getOrgScintUncInfo(int a_orgScintID) const;
668 
669 protected:
670  //this function rebuild the internal map used to reference mod id and ch to
671  //detector id's
672  void rebuildMap();
673  std::vector<OrgScintUncertaintiesInfo> m_orgScintsUnc;
674 
678  std::map<std::pair< int, int > ,int > m_modChMap;
679 
680 };
681 
682 #endif
std::ostream & printDetType(std::ostream &a_stream, DetType a_type)
Definition: ConfigClasses.cpp:75
DetType
Definition: ConfigClasses.h:20
@ OrgScintillator
Definition: ConfigClasses.h:25
@ MultiPMTOrgScintillator
Definition: ConfigClasses.h:26
@ Clover
Definition: ConfigClasses.h:24
@ ClovComptonShield
Definition: ConfigClasses.h:23
@ HPGe
Definition: ConfigClasses.h:21
@ InorgScintillator
Definition: ConfigClasses.h:27
@ NA
Definition: ConfigClasses.h:28
@ CloverLeaf
Definition: ConfigClasses.h:22
ParticleType
Definition: ConfigClasses.h:32
@ NEUTRON
Definition: ConfigClasses.h:33
@ GAMMA
Definition: ConfigClasses.h:34
@ OTHER
Definition: ConfigClasses.h:35
this class is inteded to represent of full set of information
Definition: ConfigClasses.h:341
virtual ~CloverInfo()
Definition: ConfigClasses.cpp:1457
bool hasChannel(int a_ch) const
returns trues if the channel is present in the data
Definition: ConfigClasses.cpp:1230
int getChFromLeaf(int a_leafNumber) const
Definition: ConfigClasses.cpp:1025
void setLeafTDCCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:1304
const DetectorCalib * getTCalibFromLeafCh(int a_channel) const
Definition: ConfigClasses.cpp:1139
std::vector< int > getChannels()
returns a vector with all the channels associated with this clover
Definition: ConfigClasses.cpp:1216
std::ostream & printRot(std::ostream &a_stream=std::cout) const
Definition: ConfigClasses.cpp:1429
CloverInfo()
Definition: ConfigClasses.cpp:943
std::vector< double > getLeafPositionVector(int a_leaf)
return the position of a leaf
Definition: ConfigClasses.cpp:1204
const DetectorElementInfo & getLeafInfo(int a_leafID) const
Definition: ConfigClasses.cpp:1077
const DetectorElementInfo & getDetElInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1058
void setAddBackEnCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:1320
std::vector< int > getLeafIdList() const
Definition: ConfigClasses.cpp:1106
void setBgoTDCCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:1312
bool isBGO(int a_modID, int a_ch) const
returns true if the channel and module id are a BGO
Definition: ConfigClasses.cpp:1291
const DetectorCalib * getCalibFromLeafID(int a_leafID) const
Definition: ConfigClasses.cpp:1115
bool isLeaf(int a_modID, int a_ch) const
returns true if the channel and moduel id are a leaf
Definition: ConfigClasses.cpp:1278
void addBGOInfo(DetectorElementInfo a_leaf)
Definition: ConfigClasses.cpp:938
int getChFromBGONumber(int a_BGO) const
Definition: ConfigClasses.cpp:1047
std::vector< int > getBGOInputs() const
Definition: ConfigClasses.cpp:1097
double getLeafPolarAngle(int a_leafNumber)
returns polar angle of individual leaf [in radians]
Definition: ConfigClasses.cpp:1365
const DetectorCalib * getCalibFromLeafCh(int a_channel) const
Definition: ConfigClasses.cpp:1128
int getLeafNumber(int a_channel) const
Definition: ConfigClasses.cpp:1014
const DetectorCalib * getTCalibFromLeafID(int a_leafID) const
Definition: ConfigClasses.cpp:1150
std::vector< double > getLeafNormalVector(int a_leaf)
returns the normal vector from a leaf
Definition: ConfigClasses.cpp:1192
const CutBase * getLeafTDCCut() const
Definition: ConfigClasses.cpp:1162
std::ostream & print(std::ostream &a_stream=std::cout) const
prints the internal state of the class
Definition: ConfigClasses.cpp:1414
double getLeafDistance(int a_leafNumber)
return distance of individual leaf [in meters]
Definition: ConfigClasses.cpp:1377
int getDetID() const
Definition: ConfigClasses.cpp:1092
void addLeafInfo(DetectorElementInfo a_leaf)
Definition: ConfigClasses.cpp:934
bool thisClover(int a_modID, int a_ch) const
returns true if the channel and module are associated with this detector
Definition: ConfigClasses.cpp:1249
int getBGONumber(int a_channel) const
Definition: ConfigClasses.cpp:1036
const CutBase * getaddBackCut() const
Definition: ConfigClasses.cpp:1170
CloverInfo & operator=(const CloverInfo &a_rhs)
Definition: ConfigClasses.cpp:978
const CutBase * getBgoTDCCut() const
Definition: ConfigClasses.cpp:1166
bool hasBGOChannel(int a_ch) const
Definition: ConfigClasses.cpp:1402
std::vector< double > getCenterPosition()
returns position of center of clover face (avg. of the leafs)
Definition: ConfigClasses.cpp:1176
void setWallTime(uint32_t a_t)
Definition: ConfigClasses.cpp:1328
double getLeafDistToOrig(int a_leafNumber, double a_detLength) const
returns distance to center of leaf
Definition: ConfigClasses.cpp:1389
void translate(double a_x, double a_y, double a_z)
Definition: ConfigClasses.cpp:1335
Definition: CutClasses.h:70
Definition: CalibrationClasses.h:21
Definition: ConfigClasses.h:169
int getChannel() const
Definition: ConfigClasses.cpp:423
std::ostream & print(std::ostream &a_stream) const
Definition: ConfigClasses.cpp:481
DetectorCalib * m_gainCalib
Definition: ConfigClasses.h:190
int m_channel
Definition: ConfigClasses.h:189
virtual DetectorElementInfo & operator=(const DetectorElementInfo &a_rhs)
Definition: ConfigClasses.cpp:389
int getModID() const
Definition: ConfigClasses.cpp:419
double getAzimuthalAngle()
Definition: ConfigClasses.cpp:475
void setTimeCalib(DetectorCalib *a_timeCalib)
Definition: ConfigClasses.cpp:456
void setModID(int a_modID)
Definition: ConfigClasses.cpp:435
int m_modID
Definition: ConfigClasses.h:188
DetectorCalib * getTimeCalib() const
Definition: ConfigClasses.cpp:431
void setGainCalib(DetectorCalib *a_gainCalib)
Definition: ConfigClasses.cpp:443
double getPolarAngle() const
Definition: ConfigClasses.cpp:470
DetectorCalib * m_timeCalib
Definition: ConfigClasses.h:191
virtual ~DetectorElementInfo()
Definition: ConfigClasses.cpp:492
DetectorElementInfo()
Definition: ConfigClasses.cpp:352
DetectorCalib * getGainCalib() const
Definition: ConfigClasses.cpp:427
void setChannel(int a_channel)
Definition: ConfigClasses.cpp:439
Definition: ConfigClasses.h:76
DetectorInfo()
Definition: ConfigClasses.cpp:117
double m_y
Definition: ConfigClasses.h:158
double m_rX
Definition: ConfigClasses.h:160
void setDetectorLength(double a_detLength)
Definition: ConfigClasses.cpp:172
double getY() const
Definition: ConfigClasses.cpp:288
void setrY(double a_rY)
Definition: ConfigClasses.cpp:164
void setZ(double a_z)
Definition: ConfigClasses.cpp:147
double getZ() const
Definition: ConfigClasses.cpp:292
double getrX() const
Definition: ConfigClasses.cpp:296
double getX() const
Definition: ConfigClasses.cpp:284
double m_detectorLength
Definition: ConfigClasses.h:163
std::vector< double > getDetectorCenter()
Definition: ConfigClasses.cpp:177
void setY(double a_y)
Definition: ConfigClasses.cpp:143
void setDetectorID(int a_detectorID)
Definition: ConfigClasses.cpp:135
double m_rZ
Definition: ConfigClasses.h:162
double m_z
Definition: ConfigClasses.h:159
virtual ~DetectorInfo()
Definition: ConfigClasses.cpp:347
virtual void translate(double a_x, double a_y, double a_z)
Definition: ConfigClasses.cpp:151
double getBeamScatteringAngle(double a_bx, double a_by, double a_bz, DetectorInfo &a_rhs)
Definition: ConfigClasses.cpp:222
virtual std::ostream & print(std::ostream &a_stream) const
Definition: ConfigClasses.cpp:331
DetType getDetType() const
Definition: ConfigClasses.cpp:276
int m_detectorID
Definition: ConfigClasses.h:156
double m_x
Definition: ConfigClasses.h:157
double getDistance(double a_detHalfLength) const
distance in m. detLength in m
Definition: ConfigClasses.cpp:313
void setrX(double a_rX)
Definition: ConfigClasses.cpp:160
double getSourceScatteringAngle(double a_sx, double a_sy, double a_sz, DetectorInfo &a_rhs)
Definition: ConfigClasses.cpp:240
double getScatteringAngle(double a_bx, double a_by, double a_bz, double a_sx, double a_sy, double a_sz)
Definition: ConfigClasses.cpp:191
void setX(double a_x)
Definition: ConfigClasses.cpp:139
void setDetType(DetType a_detType)
Definition: ConfigClasses.cpp:131
void setrZ(double a_rZ)
Definition: ConfigClasses.cpp:168
int getDetectorID() const
Definition: ConfigClasses.cpp:280
double getrY() const
Definition: ConfigClasses.cpp:300
double getDetectorLength() const
Definition: ConfigClasses.cpp:308
std::vector< double > getLocation(double a_stepLenght) const
Definition: ConfigClasses.cpp:322
double getDistance(float a_thisDetHalfL, float a_rhsHalfL, DetectorInfo &a_rhs)
double m_rY
Definition: ConfigClasses.h:161
DetType m_detType
Definition: ConfigClasses.h:155
double getrZ() const
Definition: ConfigClasses.cpp:304
Definition: ConfigClasses.h:431
void addSourceInfo(std::string a_id, PointSourceInfo a_source)
Definition: ConfigClasses.cpp:1626
const CloverInfo & getCloverInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1896
MultiPMTOrgScintInfo m_defMultiPMTOrgScintInfo
Definition: ConfigClasses.h:559
double getRFCalibID() const
Definition: ConfigClasses.cpp:2096
void setRFFilter(bool a_doFilter)
Definition: ConfigClasses.cpp:1651
std::vector< MultiPMTOrgScintInfo > m_PMTOrgScints
Definition: ConfigClasses.h:531
const HPGeInfo getHPGeInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:2005
CloverInfo m_defCloverInfo
Definition: ConfigClasses.h:562
DetectorCalib * m_RFOffset
RF offset to an EJ-309 detector [ns].
Definition: ConfigClasses.h:543
double detDistToOrig(DetType a_detType, int a_detID, int a_elementID=0) const
Definition: ConfigClasses.cpp:2164
void addHPGE(HPGeInfo a_HPGE)
Definition: ConfigClasses.cpp:1610
uint16_t getRFSubPeriod() const
Definition: ConfigClasses.cpp:2116
double getTDCRes() const
Definition: ConfigClasses.cpp:2108
const MultiPMTOrgScintInfo & getMultiPMTOrgScintInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1953
std::map< DetType, double > getDetectorLengths() const
Definition: ConfigClasses.cpp:2160
std::vector< CloverInfo > m_clovers
Definition: ConfigClasses.h:534
double getRFPeriod() const
Definition: ConfigClasses.cpp:2100
bool canDoGainConversion() const
Definition: ConfigClasses.cpp:2299
double m_RFPeriod
Definition: ConfigClasses.h:547
void clearDet(DetType a_type)
Definition: ConfigClasses.cpp:2405
void addMultiPMTOrgScint(MultiPMTOrgScintInfo a_orgScint)
Definition: ConfigClasses.cpp:1598
void translateCoordinates(double a_x, double a_y, double a_z)
Definition: ConfigClasses.cpp:1663
OrgScintInfo m_defOrgScintInfo
BCM data [uAmps].
Definition: ConfigClasses.h:558
bool getRFFilter() const
Definition: ConfigClasses.cpp:2112
double getRFOffset() const
Definition: ConfigClasses.cpp:2091
void setRFOffset(DetectorCalib *a_offset)
Definition: ConfigClasses.cpp:1631
std::vector< InorgScintInfo > m_inorgScints
Definition: ConfigClasses.h:532
const DetectorElementInfo & getDetElInfo(int a_modID, int a_ch) const
gets the detector element info given a modID and a channel
Definition: ConfigClasses.cpp:1781
void setRFCalibID(int a_ID)
Definition: ConfigClasses.cpp:1639
uint16_t m_rfSubPeriod
Definition: ConfigClasses.h:553
void rebuildMap()
Definition: ConfigClasses.cpp:1690
void addInorgScint(InorgScintInfo a_inorgScint)
Definition: ConfigClasses.cpp:1604
const std::vector< CloverInfo > & getCloverInfos() const
Definition: ConfigClasses.cpp:1921
std::map< DetType, double > m_detectorLengths
lengths of the detectors for TOF calculation
Definition: ConfigClasses.h:541
std::vector< int > getDetIDList(DetType a_detType) const
Definition: ConfigClasses.cpp:2031
void addDetLengths(std::map< DetType, double > a_lengthMap)
Definition: ConfigClasses.cpp:1622
void addHPGEs(std::vector< HPGeInfo > a_HPGEs)
Definition: ConfigClasses.cpp:1572
int m_RFCalibDetID
detector ID of RF offset
Definition: ConfigClasses.h:545
std::map< std::string, PointSourceInfo > m_sourceInfo
Definition: ConfigClasses.h:535
std::map< int, std::map< int, std::pair< DetType, int > > > m_modChMap
Definition: ConfigClasses.h:539
bool canDoTiming() const
Definition: ConfigClasses.cpp:2237
HPGeInfo m_defHPGeInfo
Definition: ConfigClasses.h:561
double m_TDCRes
Definition: ConfigClasses.h:549
DetType getDetType(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1848
const OrgScintInfo & getOrgScintInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1927
const InorgScintInfo getInorgScintInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1979
ExperimentConfig()
default constructor creates an empty config
Definition: ConfigClasses.cpp:1474
void addInorgScints(std::vector< InorgScintInfo > a_inorgScints)
Definition: ConfigClasses.cpp:1563
ExperimentConfig & operator=(const ExperimentConfig &a_rhs)
Definition: ConfigClasses.cpp:1526
void addClover(CloverInfo a_clover)
Definition: ConfigClasses.cpp:1616
void addClovers(std::vector< CloverInfo > a_clovers)
Definition: ConfigClasses.cpp:1581
std::vector< OrgScintInfo > m_orgScints
Definition: ConfigClasses.h:530
virtual ~ExperimentConfig()
Definition: ConfigClasses.cpp:2437
int getNumModules()
Definition: ConfigClasses.cpp:2361
void addOrgScint(OrgScintInfo a_orgScint)
Definition: ConfigClasses.cpp:1592
int getDetID(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:1869
std::vector< HPGeInfo > m_HPGEs
Definition: ConfigClasses.h:533
bool m_rfFilter
Definition: ConfigClasses.h:551
void setTDCRes(double a_TDCRes)
Definition: ConfigClasses.cpp:1647
double getRFModuleID()
Definition: ConfigClasses.cpp:2120
void setTime(uint32_t a_t)
Definition: ConfigClasses.cpp:2131
std::ostream & printLayout(std::ostream &a_stream) const
prints the internal state of the class
Definition: ConfigClasses.cpp:1827
void addOrgScints(std::vector< OrgScintInfo > a_orgScints)
Definition: ConfigClasses.cpp:1553
bool isKnown(int a_modID, int a_ch) const
returns true if the channel mod pair is known to the config
Definition: ConfigClasses.cpp:1756
InorgScintInfo m_defInorgScintInfo
Definition: ConfigClasses.h:560
bool isKnownModule(int a_modID) const
Definition: ConfigClasses.cpp:1770
void setRFPeriod(double a_RFPeriod)
Definition: ConfigClasses.cpp:1643
DetectorElementInfo m_defDetElementInfo
Definition: ConfigClasses.h:563
void setRFSubPeriod(uint16_t a_triggerPeriod)
Definition: ConfigClasses.cpp:1655
Definition: ConfigClasses.h:652
ExperimentUncertaintiesConfig()
default constructor creates an empty config
Definition: ConfigClasses.cpp:2562
void addOrgScintUnc(OrgScintUncertaintiesInfo a_orgScint)
Definition: ConfigClasses.cpp:2585
void addOrgScintsUnc(std::vector< OrgScintUncertaintiesInfo > a_orgScints)
Definition: ConfigClasses.cpp:2574
bool isKnown(int a_modID, int a_ch) const
returns true if the channel mod pair is known to the config
Definition: ConfigClasses.cpp:2603
std::ostream & printLayout(std::ostream &a_stream) const
Definition: ConfigClasses.cpp:2614
std::map< std::pair< int, int >,int > m_modChMap
Definition: ConfigClasses.h:678
void rebuildMap()
Definition: ConfigClasses.cpp:2591
const OrgScintUncertaintiesInfo getOrgScintUncInfo(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:2626
std::vector< OrgScintUncertaintiesInfo > m_orgScintsUnc
Definition: ConfigClasses.h:673
Definition: ConfigClasses.h:332
HPGeInfo()
Definition: ConfigClasses.cpp:930
Definition: ConfigClasses.h:323
InorgScintInfo()
Definition: ConfigClasses.cpp:925
Definition: ConfigClasses.h:248
bool hasModIDCh(int a_modID, int a_ch) const
Definition: ConfigClasses.cpp:790
int getTimeBaseID() const
Definition: ConfigClasses.cpp:853
MultiPMTOrgScintInfo & operator=(MultiPMTOrgScintInfo a_rhs)
assignment operator for providing deep copies in stl containers
Definition: ConfigClasses.cpp:758
void setWallTime(uint32_t a_t)
Definition: ConfigClasses.cpp:885
virtual std::ostream & print(std::ostream &a_stream) const
Definition: ConfigClasses.cpp:912
std::vector< int > getIDList() const
this function returns a list of the pmt ID's present in the detector
Definition: ConfigClasses.cpp:835
double getDtCal(int a_pmtID)
Definition: ConfigClasses.cpp:857
void addPMTInfo(int a_PMTID, OrgScintInfo &a_pmtInfo)
Definition: ConfigClasses.cpp:770
void setDtCal(int a_pmtID, double a_tc)
Definition: ConfigClasses.cpp:861
int getPMTID(int a_modID, int a_ch) const
for findig which pmt ID a channel is associated with
Definition: ConfigClasses.cpp:802
bool isFullSet(std::vector< int > a_chList)
Definition: ConfigClasses.cpp:865
void clearOScintInfo()
clears m_pmts but keeps other info
std::vector< int > getChList() const
Definition: ConfigClasses.cpp:844
void setTimeBaseID(int a_pmtID)
Definition: ConfigClasses.cpp:892
const OrgScintInfo & getPMTInfo(int a_ID) const
Definition: ConfigClasses.cpp:820
bool hasPMTID(int a_ID) const
Definition: ConfigClasses.cpp:778
MultiPMTOrgScintInfo()
default constructor puts the class into a working but empty state
Definition: ConfigClasses.cpp:739
void translate(double a_x, double a_y, double a_z)
Definition: ConfigClasses.cpp:896
Definition: ConfigClasses.h:197
bool isGamma(double a_X, double a_Y) const
Definition: ConfigClasses.cpp:646
CutBase * getNeutronCut() const
Definition: ConfigClasses.cpp:686
bool isNeutron(double a_X, double a_Y) const
Definition: ConfigClasses.cpp:641
CutBase * getEnCut() const
Definition: ConfigClasses.cpp:698
double m_E1
Definition: ConfigClasses.h:234
void setEnCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:677
void setNeutronCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:651
std::vector< double > getResParams()
Definition: ConfigClasses.cpp:596
CutBase * m_enCut
Definition: ConfigClasses.h:238
enum ParticleType getParticleType(double a_X, double a_Y) const
Definition: ConfigClasses.cpp:608
OrgScintInfo & operator=(OrgScintInfo a_rhs)
assignment operator for providing deep copies in stl containers
Definition: ConfigClasses.cpp:552
CutBase * getGammaCut() const
Definition: ConfigClasses.cpp:690
CutBase * m_neutronCut
Definition: ConfigClasses.h:239
void setResParams(double a_EC, double a_E1, double a_E2)
Definition: ConfigClasses.cpp:601
CutBase * m_psdCut
Definition: ConfigClasses.h:237
virtual ~OrgScintInfo()
Definition: ConfigClasses.cpp:711
double getLightResolution(double a_energy) const
Definition: ConfigClasses.cpp:731
CutBase * m_gammaCut
Definition: ConfigClasses.h:240
CutBase * getPSDCut() const
Definition: ConfigClasses.cpp:694
virtual std::ostream & print(std::ostream &a_stream) const
Definition: ConfigClasses.cpp:703
double m_EC
Definition: ConfigClasses.h:233
OrgScintInfo()
Definition: ConfigClasses.cpp:505
void setPSDCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:669
double m_E2
Definition: ConfigClasses.h:235
void setGammaCut(CutBase *a_cut)
Definition: ConfigClasses.cpp:660
Definition: ConfigClasses.h:606
int getChannel() const
Definition: ConfigClasses.cpp:2479
int getDetectorID() const
Definition: ConfigClasses.cpp:2471
double m_yUnc
Definition: ConfigClasses.h:637
Eigen::VectorXd m_lyParams
calibration and resolution parameters a, b, Ec, E1, E2
Definition: ConfigClasses.h:643
void setEnCutMaxUnc(double a_EncutUnc)
Definition: ConfigClasses.cpp:2557
void setZUnc(double a_zUnc)
Definition: ConfigClasses.cpp:2532
void setDetectorID(int a_detectorID)
Definition: ConfigClasses.cpp:2511
void setLYCovMat(std::vector< double > a_lyCovMat)
Definition: ConfigClasses.cpp:2541
double getZUnc() const
Definition: ConfigClasses.cpp:2491
Eigen::VectorXd getCalibrationAndResolution() const
Definition: ConfigClasses.cpp:2503
double getXUnc() const
Definition: ConfigClasses.cpp:2483
double m_EnCutMaxUnc
Definition: ConfigClasses.h:640
void setXUnc(double a_xUnc)
Definition: ConfigClasses.cpp:2524
double getEnCutMinUnc() const
Definition: ConfigClasses.cpp:2495
void setYUnc(double a_yUnc)
Definition: ConfigClasses.cpp:2528
double getYUnc() const
Definition: ConfigClasses.cpp:2487
void setChannel(int a_channel)
Definition: ConfigClasses.cpp:2519
double m_xUnc
Definition: ConfigClasses.h:636
double m_zUnc
Definition: ConfigClasses.h:638
double m_EnCutMinUnc
Definition: ConfigClasses.h:639
OrgScintUncertaintiesInfo()
Definition: ConfigClasses.cpp:2458
void setModID(int a_modID)
Definition: ConfigClasses.cpp:2515
int m_detectorID
Definition: ConfigClasses.h:633
Eigen::MatrixXd getCalibResCovariance() const
Definition: ConfigClasses.cpp:2507
int getModID() const
Definition: ConfigClasses.cpp:2475
void setLYParams(std::vector< double > a_lyParams)
Definition: ConfigClasses.cpp:2536
Eigen::MatrixXd m_lyCovariances
covariance matrix for given light yield parameters above
Definition: ConfigClasses.h:645
int m_modID
Definition: ConfigClasses.h:634
int m_channel
Definition: ConfigClasses.h:635
void setEnCutMinUnc(double a_EncutUnc)
Definition: ConfigClasses.cpp:2553
double getEnCutMaxUnc() const
Definition: ConfigClasses.cpp:2499
Definition: ConfigClasses.h:40
std::string getIsotope() const
Definition: ConfigClasses.cpp:45
double getX() const
Definition: ConfigClasses.cpp:57
void setActivity(double a_activity)
Definition: ConfigClasses.cpp:24
void setY(double a_y)
Definition: ConfigClasses.cpp:36
double getZ() const
Definition: ConfigClasses.cpp:65
void setIsotope(std::string a_isotope)
Definition: ConfigClasses.cpp:20
PointSourceInfo()
Definition: ConfigClasses.cpp:8
double getActivity() const
Definition: ConfigClasses.cpp:49
void setZ(double a_z)
Definition: ConfigClasses.cpp:40
void setEnergy(double a_energy)
Definition: ConfigClasses.cpp:28
void setX(double a_x)
Definition: ConfigClasses.cpp:32
double getY() const
Definition: ConfigClasses.cpp:61
std::vector< double > getPosVector() const
Definition: ConfigClasses.cpp:69
double getEnergy() const
Definition: ConfigClasses.cpp:53
Definition: ConfigClasses.h:571
ScintConfig()
Definition: ConfigClasses.cpp:2445