@@ -65,7 +65,7 @@ namespace sbn{
6565 // Collect device information to make BNBSpillInfo object. Used in
6666 // ICARUS and SBND modules.
6767 sbn::BNBSpillInfo makeBNBSpillInfo
68- (art::EventID const & eventID, double time, MWRdata_t const & MWRdata, std::vector<int > const & matched_MWR, std::unique_ptr<ifbeam_ns::BeamFolder> const & bfp)
68+ (art::EventID const & eventID, double time, MWRdata_t const & MWRdata, std::vector<int > const & matched_MWR, std::unique_ptr<ifbeam_ns::BeamFolder> const & bfp, const std::unique_ptr<ifbeam_ns::BeamFolder> & offsets, const std::unique_ptr<ifbeam_ns::BeamFolder> & vp873 )
6969 {
7070
7171 auto const & [ MWR_times, unpacked_MWR ] = MWRdata; // alias
@@ -87,8 +87,20 @@ namespace sbn{
8787 double BTJT2 = 0 ; // units Deg C
8888 double THCURR = 0 ; // units kiloAmps
8989
90+
91+ double VP873 = 0 ; // units mm; not in the first IFBeam query bunch
92+ double HP875Offset =0 ;// units mm; make a another separate IFBeam query bunch for offsets
93+ double VP875Offset =0 ;// units mm
94+ double VP873Offset =0 ;// units mm
95+ double HPTG1Offset =0 ;// units mm
96+ double HPTG2Offset =0 ;// units mm
97+ double VPTG1Offset =0 ;// units mm
98+ double VPTG2Offset =0 ;// units mm
99+
90100 double TOR860_time = 0 ; // units s
91-
101+
102+ double FOM =0 ;
103+
92104 // Here we request all the devices
93105 // since sometimes devices fail to report we'll
94106 // allow each to throw an exception but still move forward
@@ -107,6 +119,21 @@ namespace sbn{
107119 try {bfp->GetNamedData (time, " E:VPTG2" ,&VPTG2);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
108120 try {bfp->GetNamedData (time, " E:BTJT2" ,&BTJT2);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
109121 try {bfp->GetNamedData (time, " E:THCURR" ,&THCURR);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
122+
123+
124+
125+ try {bfp->GetNamedData (time, " E:VP873" ,&VP873);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
126+
127+ try {offsets->GetNamedData (time, " E_VP873S" ,&VP873Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
128+ try {offsets->GetNamedData (time, " E_HP875S" ,&HP875Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
129+ try {offsets->GetNamedData (time, " E_VP875S" ,&VP875Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
130+ try {offsets->GetNamedData (time, " E_HPTG1S" ,&HPTG1Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
131+ try {offsets->GetNamedData (time, " E_HPTG2S" ,&HPTG2Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
132+ try {offsets->GetNamedData (time, " E_VPTG1S" ,&VPTG1Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
133+ try {offsets->GetNamedData (time, " E_VPTG2S" ,&VPTG2Offset);}catch (WebAPIException &we) {mf::LogDebug (" SBNDBNBRetriever" )<< " At time : " << time << " " << " got exception: " << we.what () << " \n " ;}
134+
135+
136+
110137
111138 // crunch the times
112139 unsigned long int time_closest_int = (int ) TOR860_time;
@@ -129,6 +156,17 @@ namespace sbn{
129156 beamInfo.THCURR = THCURR;
130157 beamInfo.spill_time_s = time_closest_int;
131158 beamInfo.spill_time_ns = time_closest_ns;
159+ beamInfo.VP873 = VP873;
160+ beamInfo.VP873Offset = VP873Offset;
161+ beamInfo.HP875Offset = HP875Offset;
162+ beamInfo.VP875Offset = VP875Offset;
163+ beamInfo.HPTG1Offset = HPTG1Offset;
164+ beamInfo.HPTG2Offset = HPTG2Offset;
165+ beamInfo.VPTG1Offset = VPTG1Offset;
166+ beamInfo.VPTG2Offset = VPTG2Offset;
167+ beamInfo.FOM = FOM;
168+
169+
132170
133171 for (auto const & MWRdata: unpacked_MWR){
134172 std::ignore = MWRdata;
@@ -166,7 +204,11 @@ namespace sbn{
166204 // information, so we'll write it to the SubRun
167205
168206 beamInfo.event = eventID.event (); // the rest of ID is known by art::SubRun
169-
207+
208+ // for(size_t m=0; m< beamInfo.M875BB.size(); m++){
209+ // std::cout << "M875BB: " <<beamInfo.M875BB[m] << " | M876BB: " << beamInfo.M876BB[m] << " | MMTBB: " << beamInfo.MMBTBB[m] <<std::endl;
210+ // }
211+
170212 return beamInfo;
171213 }
172214
@@ -331,4 +373,8 @@ namespace sbn{
331373
332374 return { std::move (MWR_times), std::move (unpacked_MWR) };
333375 }
376+
334377}
378+
379+
380+
0 commit comments