69 *
header_ =
event->getEventHeaderMutable();
71 EVENT::LCEvent* lc_event =
event->getLCEvent();
73 int evtNumber = lc_event->getEventNumber();
75 std::cout<<
"Event Number: "<<evtNumber<<std::endl;
76 std::cout<<
"Run Number: "<<runNumber<<std::endl;
83 std::cout<<
"Save: "<<runNumber<<
" "<<evtNumber<<std::endl;
119 EVENT::LCCollection* vtp_data
120 =
static_cast<EVENT::LCCollection*
>(
event->getLCCollection(
vtpCollLcio_.c_str()));
123 EVENT::LCGenericObject* vtp_datum
124 =
static_cast<EVENT::LCGenericObject*
>(vtp_data->getElementAt(0));
128 catch (EVENT::DataNotAvailableException e) {
129 std::cout <<
"EventProcessor::process: 2019/2021 VTP trigger collection requested but missing!" << std::endl;
134 EVENT::LCCollection* ts_data
135 =
static_cast<EVENT::LCCollection*
>(
event->getLCCollection(
tsCollLcio_.c_str()));
137 EVENT::LCGenericObject* ts_datum
138 =
static_cast<EVENT::LCGenericObject*
>(ts_data->getElementAt(0));
142 catch (EVENT::DataNotAvailableException e) {
143 std::cout <<
"EventProcessor::process: 2019/2021 TSBank trigger collection is missing!" << std::endl;
149 EVENT::LCCollection* trigger_data
150 =
static_cast<EVENT::LCCollection*
>(
event->getLCCollection(
trigCollLcio_.c_str()));
152 for (
int itrigger = 0; itrigger < trigger_data->getNumberOfElements(); ++itrigger) {
154 EVENT::LCGenericObject* trigger_datum
155 =
static_cast<EVENT::LCGenericObject*
>(trigger_data->getElementAt(itrigger));
157 if (trigger_datum->getIntVal(0) == 0xe10a) {
175 EVENT::LCCollection* rf_hits
176 =
static_cast<EVENT::LCCollection*
>(
event->getLCCollection(
rfCollLcio_.c_str()));
179 if (rf_hits->getNumberOfElements() > 1) {
180 throw std::runtime_error(
"[ EventProcessor ]: The collection "
182 +
" doesn't have the expected number of elements.");
186 for (
int ihit = 0; ihit < rf_hits->getNumberOfElements(); ++ihit) {
189 EVENT::LCGenericObject* rf_hit
190 =
static_cast<EVENT::LCGenericObject*
>(rf_hits->getElementAt(ihit));
193 if (rf_hit->getNDouble() != 2) {
194 throw std::runtime_error(
"[ EventProcessor ]: The collection "
196 +
" has the wrong structure.");
200 for (
int ichannel = 0; ichannel < rf_hit->getNDouble(); ++ichannel) {
204 }
catch(EVENT::DataNotAvailableException e) {
220 for(
int i=0; i<vtp_data_lcio->getNInt()/2; ++i)
222 int data = vtp_data_lcio->getIntVal(i);
223 int secondWord = vtp_data_lcio->getIntVal(i+1);
224 if(!(data & 1<<31))
continue;
225 int type = (data>>27)&0x0F;
252 vtpData->
trigTime = (data & 0x00FFFFFF) + ((secondWord & 0x00FFFFFF )<<24);
257 subtype = (data>>23)&0x0F;
261 clus.
X = (data )&0x0003F;
263 if((clus.
X >> 5 & 0x1) == 0x1) clus.
X = -((clus.
X ^ 0x3F) + 1);
264 clus.
Y = (data >> 6)&0x0000F;
266 if((clus.
Y >> 3 & 0x1) == 0x1) clus.
Y = -((clus.
Y ^ 0xF) + 1);
267 clus.
E = (data >> 10)&0x01FFF;
268 clus.
subtype = (data >> 23)&0x0000F;
269 clus.
type = (data >> 27)&0x0000F;
270 clus.
istype = (data >> 31)&0x00001;
271 clus.
T = (secondWord )&0x003FF;
272 clus.
N = (secondWord >> 10)&0x0000F;
273 clus.
nothing = (secondWord >> 14)&0x3FFFF;
280 strig.
T = (data )&0x003FF;
281 strig.
emin = (data >> 10)&0x00001;
282 strig.
emax = (data >> 11)&0x00001;
283 strig.
nmin = (data >> 12)&0x00001;
284 strig.
xmin = (data >> 13)&0x00001;
285 strig.
pose = (data >> 14)&0x00001;
286 strig.
hodo1c = (data >> 15)&0x00001;
287 strig.
hodo2c = (data >> 16)&0x00001;
288 strig.
hodogeo = (data >> 17)&0x00001;
289 strig.
hodoecal = (data >> 18)&0x00001;
290 strig.
topnbot = (data >> 19)&0x00001;
291 strig.
inst = (data >> 20)&0x00007;
292 strig.
subtype = (data >> 23)&0x0000F;
293 strig.
type = (data >> 27)&0x0000F;
294 strig.
istype = (data >> 31)&0x00001;
300 ptrig.
T = (data )&0x003FF;
301 ptrig.
clusesum = (data >> 10)&0x00001;
302 ptrig.
clusedif = (data >> 11)&0x00001;
303 ptrig.
eslope = (data >> 12)&0x00001;
304 ptrig.
coplane = (data >> 13)&0x00001;
305 ptrig.
dummy = (data >> 14)&0x0001F;
306 ptrig.
topnbot = (data >> 19)&0x00001;
307 ptrig.
inst = (data >> 20)&0x00007;
308 ptrig.
subtype = (data >> 23)&0x0000F;
309 ptrig.
type = (data >> 27)&0x0000F;
310 ptrig.
istype = (data >> 31)&0x00001;
316 ctrig.
T = (data )&0x003FF;
317 ctrig.
reserved = (data >> 10)&0x001FF;
319 ctrig.
LEDTrig = (data >> 20)&0x00001;
320 ctrig.
hodoTrig = (data >> 21)&0x00001;
322 ctrig.
subtype = (data >> 23)&0x0000F;
323 ctrig.
type = (data >> 27)&0x0000F;
324 ctrig.
istype = (data >> 31)&0x00001;
330 clmul.
T = (data )&0x003FF;
331 clmul.
multtop = (data >> 10)&0x0000F;
332 clmul.
multbot = (data >> 14)&0x0000F;
333 clmul.
multtot = (data >> 18)&0x0000F;
334 clmul.
bitinst = (data >> 22)&0x00001;
335 clmul.
subtype = (data >> 23)&0x0000F;
336 clmul.
type = (data >> 27)&0x0000F;
337 clmul.
istype = (data >> 31)&0x00001;
343 fee.
T = (data )&0x003FF;
344 fee.
region = (data >> 10)&0x0007F;
345 fee.
reserved = (data >> 17)&0x0003F;
346 fee.
subtype = (data >> 23)&0x0000F;
347 fee.
type = (data >> 27)&0x0000F;
348 fee.
istype = (data >> 31)&0x00001;
353 std::cout <<
"At " << i <<
" invalid HPS type: " << type <<
" subtype: " << subtype << std::endl;
359 std::cout << i <<
"VTP data type not valid: " << type << std::endl;
362 std::cout << i <<
"I was not expecting a VTP data type of " << type << std::endl;