eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TBasicHeaderModule.hxx
Go to the documentation of this file.
1 ///
2 /// For questions or suggestions about this module please contact the
3 /// current responsible and CC in the eventAnalysis package manager.
4 ///
5 /// 23-May-2014: Current responsible for this module is,
6 /// Luke Pickering (lp208 [*a*t*] ic.ac.uk)
7 #ifndef TBasicHeaderModule_hxx_seen
8 #define TBasicHeaderModule_hxx_seen
9 #include <TNamed.h>
10 #include <TRef.h>
11 #include <TTree.h>
12 #include <TFieldManager.hxx>
13 #include <TND280Event.hxx>
14 #include <TOAMagneticField.hxx>
15 #include <string>
17 #include "TG4PrimaryParticle.hxx"
18 #include "TGeomInfo.hxx"
19 namespace ND {
20  class TBasicHeaderModule;
21 };
22 /// An analysis module which carries some simple event-level header
23 /// information. It contains the RunID, EventNumber, and a TRef reference
24 /// back to the original event file. The latter does not work at this time.
26 public:
27  TBasicHeaderModule(const char *name = "BasicHeader",
28  const char *title = "Basic Header Module");
29  virtual ~TBasicHeaderModule();
30  virtual Bool_t IsEnabledByDefault() const { return kTRUE; }
31  void SayAvailableOpts(std::string indent = "") {
32  std::cout << indent
33  << "={software_version}: Will save software version as determined by\n"
34  << indent << "\t$ND280ROOT (cmt) \n"
35  << indent << "\t or \n "
36  << indent << "\t$ND280SOFTWAREMASTERROOT (cmake) \n"
37  << indent << "=noVersion: Will not save software version\n"
38  << indent << "=OverrideSWVersion_<n>: Will save software version as\n"
39  << indent
40  << "\tn, useful for developing versioned upstream \n"
41  << indent << "\tcode. This overrides TBasicHeaderModule=software_version"
42  << std::endl;
43  }
44  UInt_t GetEventTime() { return fEventTime; }
45  virtual Bool_t ProcessFirstEvent(ND::TND280Event &);
46  Bool_t P0DWaterStatus();
47  Bool_t Configure(std::string &);
48 protected:
49  virtual void InitializeBranches();
50  virtual bool FillTree(ND::TND280Event &);
51 public:
52 //*******************Tree Entries********************
53 ///\short Time of the relevant ND::TND280Event's last GPS pulse in Unix time.
54 ///\details Revtrieved from the ND::TND280Event header like
55 ///\dontinclude TBasicHeaderModule.cxx
56 ///\skipline GetMCMSecond
57  UInt_t fEventTime; ///< Time of the relevant ND::TND280Events last GPS pulse in Unix time.
58 ///\short Bits containing various information from the MCMs including
59 /// event/spill numbers and trigger flags.
60 ///\details For bit definitions see ND::TND280Event::Header::GetTriggerWord
61 ///\dontinclude TBasicHeaderModule.cxx
62 ///\skipline GetTriggerWord
63  ULong64_t fTriggerWord; ///< Information from the MCMs
64 /// FGD Cosmic trigger flag.
65 /// Uses bits from TBasicHeaderModule::fTriggerWord
66 ///\dontinclude TBasicHeaderModule.cxx
67 ///\skipline ULong64_t shift
68 ///\skipline shift&fTriggerWord
69  Bool_t fFGDCosmicEvent; ///< FGD Cosmic trigger flag.
70 /// TRIP-t Cosmic trigger flag.
71 /// Uses bits from TBasicHeaderModule::fTriggerWord
72 ///\dontinclude TBasicHeaderModule.cxx
73 ///\skip shift&fTriggerWord
74 ///\skip shift =
75 ///\until shift&fTriggerWord
76  Bool_t fTripTCosmicEvent; ///< TRIP-t Cosmic trigger flag.
77 /// Contains the bit patterns from the cosmic trigger module.
78 ///\dontinclude TBasicHeaderModule.cxx
79 ///\skip ULong64_t shift
80 ///\skip for
81 ///\until }
82  ULong64_t fCTMTriggerPattern[3]; ///< Bit patterns from the cosmic trigger module.
83 /// TripT Cosmic Trigger type: trigger codes from 0-14, -1 means off.
84 ///\dontinclude TBasicHeaderModule.cxx
85 ///\skip fTripTCosmicTriggerType =
86 ///\skip if
87 ///\until }
88 /// From comments in <b>cosmicTriggerGeant4Sim/src/TTripTTrigger.cxx:1196</b>\n
89 /// Value corresponds to which "detector walls" were hit:
90 /// <ul><li>-1. Unused</li>
91 /// <li>0. Top and Bottom</li>
92 /// <li>1. Top and Left</li>
93 /// <li>2. Top and Right</li>
94 /// <li>3. Left and Bottom</li>
95 /// <li>4. Top and Bottom</li>
96 /// <li>5. Left and Right</li>
97 /// <li>6. Top and Front(P0D)</li>
98 /// <li>7. Top and End(DsECal)</li>
99 /// <li>8. Left and Front(P0D)</li>
100 /// <li>9. Left and End(DsECal)</li>
101 /// <li>10. Right and Front(P0D)</li>
102 /// <li>11. Right and End(DsECal)</li>
103 /// <li>12. Front and Bottom</li>
104 /// <li>13. End(DsECal) and Back</li>
105 /// <li>14. Front(P0D) and End(DsECal)</li></ul>
106  Int_t fTripTCosmicTriggerType; ///< TripT Cosmic Trigger type:
107 /// If cosmic muon is detmined to be *upward going*, 0 or 1.
108 ///\dontinclude TBasicHeaderModule.cxx
109 ///\skip fTripTCosmicTriggerUpward =
110 ///\skip if
111 ///\until ;
112  Int_t fTripTCosmicTriggerUpward; ///< If cosmic muon is detmined to be *upward going*, 0 or 1.
113 /// MC event weighting to correct for differences between cosmic MC and data.
114 /// Weights individual cosmic trigger configurations, e.g. SMRD Primitive 5 +
115 /// DsECal Primitive 32.
116 /// See
117 /// http://www.t2k.org/nd280/physics/cosmics/meetings/May09/Clarkprescale
118 /// for detailed explanation.
119 ///\dontinclude TBasicHeaderModule.cxx
120 ///\skip fCosmicPrescaleWeight =
121 ///\until }
122  Double_t fCosmicPrescaleWeight; ///< MC event weighting to correct for differences between cosmic MC and data.
123 /// Event Spill number.
124 /// Retrieved from ND::TND280Context::GetSpill
125  Int_t fSpill; ///< Spill number
126 /// The subdetector configuration in which the data was taken
127 /// Valid values are defined in ND::TND280Context as
128 /// <ul><li>kGlobalPartition = 1</li>
129 /// <li>kP0DClockPresent = 1<<1</li>
130 /// <li>kTPCClockPresent = 1<<2</li>
131 /// <li>kFGDClockPresent = 1<<3</li>
132 /// <li>kECalClockPresent = 1<<4</li>
133 /// <li>kSMRDClockPresent = 1<<5</li>
134 /// <li>kINGRIDClockPresent = 1<<6</li>
135 /// <li>kMCData = 1<<16</li> </ul>
136  Int_t fPartition; ///< subdetector configuration
137 /// The unix time stamp of the event context.
138 /// Retrieved from ND::TND280Context::GetTimeStamp
139  Int_t fTimeStamp; ///< unix time stamp of the event
140 /// Whether this is detector data.
141 /// Retrieved from ND::TND280Context::IsDetector
142  Bool_t fIsDetector; ///< Whether this is detector data.
143 /// Whether this is an MC event.
144 /// Retrieved from ND::TND280Context::IsMC
145  Bool_t fIsMC; ///< Whether this is an MC event
146 /// Whether this is a Sand Muon MC event.
147 /// Calculated from the run number, assumes that it of the form described in
148 /// http://www.t2k.org/nd280/datacomp/production005/mcp/sand_mc\n
149 /// Run Number 9ABCDEEE, where <tt>IsSand = true</tt> if
150 ///<tt>fIsMC == true</tt> and <tt>D == 7</tt>.
151 ///\warning This is no longer definite as the Gas Interaction control sample
152 /// uses <tt>D == 7</tt>. This branch will be turned off for now. 2015-3-30
153  Bool_t fIsSand; ///< Whether this is a Sand Muon MC event.
154 /// Whether the P0D is filled with water or not.
155 /// Ascertained by querying the geometry.
156 ///\dontinclude TBasicHeaderModule.cxx
157 ///\skip bool ND::TBasicHeaderModule::P0DWaterStatus
158 ///\until else
159 ///\until }
160  Bool_t fP0DWaterStatus; ///< Whether the P0D is filled with water or not.
161 /// Event Geometry SHA1 Hash (ID)
162  UInt_t fGeometryHash[5]; ///< Event Geometry SHA1 Hash
163 /// Event Alignment SHA1 Hash (ID)
164 /// The alignment identifier is a SHA1 hash code of the alignment constants
165 /// plus a documentation string.
166  UInt_t fAlignmentId[5]; ///< Event Alignment SHA1 Hash (ID)
167 /// MC "intensity", will be 0 if unused.
168 /// The intensity corresponds to Protons/Spill for Beam MC.
169  Float_t fMCIntensity; ///<The intensity corresponds to Protons/Spill for Beam MC.
170 /// The software version string.
171 /// If -O TBasicHeaderModule=*version* is passed on the CLI then this will get
172 /// its value from the envvar $ND280ROOT
173 /// If -O TBasicHeadModule=OverrideSWVersion_v123r456p789 is passed on the CLI
174 /// then this will be set to v123r456p789.
175 ///\note The OverrideVersion version will take precedence.
176  Char_t fSoftwareVersion[50]; ///< The nd280 software version
177 /// Holder for the Software Override Version String
178  std::string fSoftwareOverrideVersionString; ///< Software Override Version
179 /// The magnetic field strength at the center of TPC1.
180 ///\dontinclude TBasicHeaderModule.cxx
181 ///\skip fMagneticFieldStrength =
182 ///\until ;
183  Double_t fMagneticFieldStrength; ///< magnetic field strength at the center of TPC1.
184 private:
185 /// Whether we are saving the software version from $ND280ROOT.
186  bool fSoftware;
187 /// Whether we are using a supplied software version. Will override fSoftware.
189 /// Whether we have found the version already, so no need to do it again.
191 };
192 #endif
Bool_t fSoftwareUseOverrideVersion
Whether we are using a supplied software version. Will override fSoftware.
UInt_t fGeometryHash[5]
Event Geometry SHA1 Hash (ID)
Float_t fMCIntensity
MC &quot;intensity&quot;, will be 0 if unused.
virtual void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
Double_t fCosmicPrescaleWeight
MC event weighting to correct for differences between cosmic MC and data.
virtual Bool_t ProcessFirstEvent(ND::TND280Event &)
Is called after the first event is loaded in.
bool fSoftware
Whether we are saving the software version from $ND280ROOT.
ULong64_t fTriggerWord
Bits containing various information from the MCMs including event/spill numbers and trigger flags...
virtual Bool_t IsEnabledByDefault() const
Is the module is enabled by default.
Bool_t fIsSand
Whether this is a Sand Muon MC event.
Int_t fPartition
The subdetector configuration in which the data was taken Valid values are defined in ND::TND280Conte...
Int_t fTimeStamp
The unix time stamp of the event context.
Int_t fTripTCosmicTriggerUpward
If cosmic muon is detmined to be upward going, 0 or 1.
Bool_t fIsMC
Whether this is an MC event.
Bool_t Configure(std::string &)
A function that allows the module to be configured from an external class without any dependencies...
void SayAvailableOpts(std::string indent="")
Subclasses should override this to let a user know what options are available.
Double_t fMagneticFieldStrength
The magnetic field strength at the center of TPC1.
Char_t fSoftwareVersion[50]
The software version string.
std::string fSoftwareOverrideVersionString
Holder for the Software Override Version String.
Int_t fTripTCosmicTriggerType
TripT Cosmic Trigger type: trigger codes from 0-14, -1 means off.
Bool_t fIsDetector
Whether this is detector data.
UInt_t fAlignmentId[5]
Event Alignment SHA1 Hash (ID) The alignment identifier is a SHA1 hash code of the alignment constant...
Bool_t fTripTCosmicEvent
TRIP-t Cosmic trigger flag.
UInt_t fEventTime
Time of the relevant ND::TND280Event&#39;s last GPS pulse in Unix time.
ULong64_t fCTMTriggerPattern[3]
Contains the bit patterns from the cosmic trigger module.
A base class for analysis output modules which contain event header information.
TBasicHeaderModule(const char *name="BasicHeader", const char *title="Basic Header Module")
For questions or suggestions about this module please contact the current responsible and CC in the e...
An analysis module which carries some simple event-level header information.
Int_t fSpill
Event Spill number.
Bool_t fP0DWaterStatus
Whether the P0D is filled with water or not.
Bool_t fFGDCosmicEvent
FGD Cosmic trigger flag.
bool fFoundSoftwareVersion
Whether we have found the version already, so no need to do it again.
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:43:58 for eventAnalysis by doxygen 1.8.5