5 #include <TBeamDataSingleton.hxx>
11 #include "../cvstags/TBeamSummaryDataModule.cxx"
20 "Module incorporating Beam Summary Data as provided by the beamline "
25 new TClonesArray(
"ND::TBeamSummaryDataModule::TBeamSummaryData", 200);
32 ND280Log(
"TBeamSummaryDataModule summary; total events processed = "
34 <<
"; total events with no BSD information = " << fEventsWithNoBSD);
41 fOutputTree->Branch(
"BeamSummaryDataStatus", &fBeamSummaryDataStatus,
42 "BeamSummaryDataStatus/I", fBufferSize);
43 fOutputTree->Branch(
"ND280Spill", &fND280Spill,
"ND280Spill/I", fBufferSize);
44 fOutputTree->Branch(
"BeamSummaryData", &fBeamSummaryData, fBufferSize,
46 fOutputTree->GetBranch(
"BeamSummaryDataStatus")
48 " Flag : Beam Summary Data is available or not in the spill. 1 = "
49 "BSD is available. 0 is not.");
50 fOutputTree->GetBranch(
"ND280Spill")
51 ->SetTitle(
" ND280 Spill Number. 16 bit.");
56 if(fFilledConfigTree){
57 ND280NamedWarn(
"TBeamSummaryDataModule",
"Module: " << this->GetName()
58 <<
" has already written the config tree this run.");
60 configTree->Branch(
"TotalEvents", &fTotalEvents);
61 configTree->Branch(
"EventsWithNoBSD", &fEventsWithNoBSD);
68 fBeamSummaryDataStatus = 0;
71 if (event.GetContext().IsMC())
return true;
73 ND::TRawBeamData& fRawBeamData = ND::TBeamDataSingleton::Get();
74 fBeamSummaryData->Clear();
76 Int_t spill =
event.GetHeader().GetSpillNumber();
78 Int_t mcmTime =
event.GetHeader().GetMCMSecond();
79 Int_t trigger =
event.GetHeader().GetTriggerBits();
85 bool ret = fRawBeamData.GetSpill(spill, mcmTime, 1);
87 if (ret ==
true && (mcmTime - fRawBeamData.GetTriggerTime(0)) >= 0) {
88 fBeamSummaryDataStatus = 1;
100 bsd->
BSDVersion = fRawBeamData.GetBSDVersion();
103 for (
int bunch_1 = 0; bunch_1 < 8; ++bunch_1) {
105 fRawBeamData.GetProtonsPerBunch(4, bunch_1 + 1);
107 fRawBeamData.GetBeamBunchTiming(4, bunch_1 + 1);
109 fRawBeamData.GetBeamBunchFlag(4, bunch_1 + 1);
119 fRawBeamData.GetCTPOT(0);
120 for (
int whichct = 0; whichct < 5;
122 if (fRawBeamData.GetProtonsPerSpill(whichct) ==
123 fRawBeamData.GetCTPOT(0)) {
129 for (
int bunch_1 = 0; bunch_1 < 8; ++bunch_1) {
131 fRawBeamData.GetCTPOT(bunch_1 + 1);
133 fRawBeamData.GetBeamBunchTiming(tmpct, bunch_1 + 1);
135 fRawBeamData.GetBeamBunchFlag(tmpct, bunch_1 + 1);
152 for (
int iGPS = 0; iGPS < 3; ++iGPS) {
155 fRawBeamData.GetTriggerTimeNanoSecond(iGPS);
160 for (
int ct = 0; ct < 5; ++ct) {
165 for (
int bunch_2 = 0; bunch_2 < 9; ++bunch_2) {
167 fRawBeamData.GetProtonsPerBunch(ct, bunch_2);
169 fRawBeamData.GetBeamBunchTiming(ct, bunch_2);
171 fRawBeamData.GetBeamBunchFlag(ct, bunch_2);
175 for (
int ihorn = 0; ihorn < 3; ++ihorn) {
178 for (
int ch = 0; ch < 5; ++ch) {
180 fRawBeamData.GetHornBusBarCurrent(ihorn, ch);
183 for (
int dir = 0; dir < 2; ++dir) {
185 fRawBeamData.GetBeamDirectionOnTarget(dir);
187 fRawBeamData.GetBeamSizeOnTarget(dir);
215 if (fBeamSummaryDataStatus == 0) {
216 fBeamSummaryDataStatus = -1;
void FillConfigTree(TTree *configTree)
Int_t MRRunNumber
Main Ring Run Number.
virtual ~TBeamSummaryData()
Int_t SpillNumber
Spill Number in 32 bit.
Double_t MumonSiwY
Beam Y Width on MUMON measured by the Sidetectors. [mm].
Int_t GPSStatus[2]
Status of GPS. [0] = GPS1, [1] = GPS2.
Double_t MumonICwY
Beam Y Width on MUMON measured by the ionizationchambers [mm].
virtual Bool_t ProcessFirstEvent(ND::TND280Event &)
Is meant to reference back to the original file [FIXME] The EventTRef does not currently work...
Int_t GoodSpillFlag
Good Spill Flag. Values >=1 = Good Spill, with 1being at 250 kA, 2 at 200 kA, 100 at 0 kA...
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
virtual void InitializeBranches()
Initialize Branches. Don't do anything else in this function.
Double_t Horn3CurrentSum
Horn3 Current. [kA].
Int_t OfficialBeamFlag
Flag describing that the Proton Beam isdetected or not for the official CT for a givenspill. 1 = extracted, 0 = not extracted.
ClassImp(ND::TBeamSummaryDataModule::TBeamSummaryData)
Double_t ProtonsPerSpill[5]
Number of Protons in the SPILL countedby CTs, [0] = CT1,..[4] = CT5.
Double_t BeamBunchFlag[5][9]
Flag describing that the Proton Beamis detected by CTs or not in the BUNCH(1st-8th). 1 = extracted, 0 = notextracted.
std::string fDescription
A longish descrition of the analysis.
virtual ~TBeamSummaryDataModule()
Double_t OTRwXError
Error of OTRwX [mm].
Double_t OTRX
Beam X Position measured by the OTR. [mm].
Double_t HornCurrent[3]
Horn Current. [0-3] = Horn1 - Horn3. [kA].
Double_t MumonSiY
Beam Y Position on MUMON measured by the Sidetectors. [mm].
Int_t GoodSpillFlag
Status Flag of Spill. This Flag contains allinformation above and should be used to defindethe flag i...
Int_t BeamRunNumber
Beam Run Number in neutrino beamline.
Double_t OTRLightYield
Light Yield of OTR.
Int_t TriggerFlag
Status Flag of Beam Trrigger. 1 = GOOD. 0 = BAD.
Double_t CT5BeamBunchTiming[8]
Timing of Proton beam BUNCH (1st-8th)measured by CT5, which is the mostdownstream charge transferer...
Double_t BeamTiming[5]
Timing of Proton beam measured by CTs. [0-4]= CT1-CT5. Time 0 is Trigger Time. [micro sec]...
TBeamSummaryDataModule(const char *name="BeamSummaryData", const char *title="Beam Summary Data")
Double_t CT5ProtonsPerBunch[8]
Number of Protons in the BUNCH(1st-8th) counted by CT5, which is themost downstream charge transferer...
Int_t BeamRunNumber
Beam Run Number in Neutrino beamline.
Int_t CT5BeamBunchFlag[8]
Flag describing that the Proton Beam isdetected by CT5 or not in the BUNCH(1st-8th). 1 = extracted, 0 = not extracted.
std::string fCVSID
Defined if an official tagged version.
Double_t MumonSiwX
Beam X Width on MUMON measured by the Sidetectors. [mm].
void SetNameTitle(char const *name, char const *title)
Double_t OTRwY
Beam Y Width measured by the OTR. [mm].
Int_t SpillFlag
Status Flag of Spill. 1 = GOOD. 0 = BAD.
TClonesArray * fBeamSummaryData
Data structure which contains beamsummary data information.
Double_t Horn2CurrentSum
Horn2 Current. [kA].
Double_t CT5ProtonsPerSpill
Number of Protons in the SPILL counted byCT5, which is the most downstream chargetransferer. [POT].
Double_t MumonICTotalQ
MUMON Total Charge measured by theionization chambers.
Int_t GoodGPSFlag
Status Flag of GPSs. 1 = GOOD. 0 = BAD.
Double_t BeamSizeOnTarget[2]
Beam Size on the target. [0..1] = [xand y]. [mm].
virtual void InitializeModule()
Initialize Module, override if necessary.
Double_t MumonSiPeak
MUMON Si Peak.
Double_t BeamDirectionOnTarget[2]
Beam Direction on the target.[0..1] = [x and y]. [mm].
Double_t OTRXError
Error of OTRX [mm].
Int_t TriggerTimeNanoSecond[3]
Trigger Time for sub-second (in nanosec), [0] = GPS1, [1] = GPS2, [2] = Rbclock system.
Double_t OTRwX
Beam X Width measured by the OTR. [mm].
Double_t BeamBunchTiming[5][9]
Timing of Proton beam BUNCH measuredby CTs. [0-4] = CT1-CT5, [0-8] = Wholeof bunches, 1st bunch, ... 8th bunch.Time 0 is Trigger Time. [micro sec].
Double_t OTRY
Beam Y Position measured by the OTR. [mm].
Double_t OTRwYError
Error of OTRwY [mm].
virtual Bool_t Configure(std::string &option)
A function that allows the module to be configured from an external class without any dependencies...
Double_t MumonSiX
Beam X Position on MUMON measured by the Sidetectors. [mm].
Double_t OfficialBeamBunchTiming[8]
Timing of Proton beam BUNCH(1st-8th) in the official analysis,usually CT5. Time 0 is TriggerTime...
Int_t GPS1TriggerTime
GPS1 Trigger Time (Unix Time in sec)
std::string fCVSTagName
Defined if an official tagged version.
Double_t OfficialCTNumber
Gives the CT used for the POT calculation.Usually CT5.
Double_t MumonICY
Beam Y Position on MUMON measured by theionization chambers [mm].
Int_t OfficialBeamBunchFlag[8]
Flag describing that the Proton Beamis detected or not in the BUNCH(1st-8th) for the official CT for ...
Double_t Horn1CurrentSum
Horn1 Current. [kA].
Double_t MumonICPeak
MUMON Peak measured by the ionization chambers.
TString BSDVersion
BSD version information. Currently "v01" is thenewest.
Double_t HornBusBarCurrent[3][5]
Horn Current for each busbar.[0..3][] = Horn1..Horn3. [][0..4] =individual ch. [kA].
Double_t MumonSiTotalQ
MUMON Total Charge measured by the Si detectors.
Int_t TriggerTime[3]
Trigger Time (Unix Time in sec), [0] = GPS1,[1] = GPS2, [2] = Rb clock system.
Int_t SpillNumber
Spill Number in 32 bit.
Double_t MumonICX
Beam X Position on MUMON measured by theionization chambers [mm].
Double_t OfficialProtonsPerBunch[8]
Number of Protons in the BUNCH(1st-8th) counted in the officialanalysis, normally from CT5...
Int_t GPS1TriggerTimeNanoSecond
GPS1 Trigger Time for sub-second (innano sec)
Double_t MumonICwX
Beam X Width on MUMON measured by the ionizationchambers [mm].
Double_t OfficialProtonsPerSpill
Number of Protons in the SPILL forthe official analysis, normally CT5.[POT].
Double_t ProtonsPerBunch[5][9]
Number of Protons in the BUNCHcounted by CTs, [0-4] = CT1-CT5, [0-8]= Whole of bunches, 1st bunch, ... 8thbunch.
Double_t BeamFlag[5]
Flag describing that the Proton Beam isdetected by CTs or not. 1 = extracted, 0 = notextracted...
Double_t OTRYError
Error of OTRY [mm].
virtual void FillConfigTree(TTree *)