8#include "GaudiKernel/MsgStream.h"
21 char names25[25][6] = {
"EMB0",
"EMB1",
"EMB2",
"EMB3",
22 "EME0",
"EME1",
"EME2",
"EME3",
23 "HEC0",
"HEC1",
"HEC2",
"HEC3",
24 "TiB0",
"TiB1",
"TiB2",
25 "TiG1",
"TiG2",
"TiG3",
26 "TiE0",
"TiE1",
"TiE2",
27 "FCa0",
"FCa1",
"FCa2",
31 char names1[1][6] = {
"Muon"};
34 char names3[3][6] = {
"Muon",
"E.M.",
"Had."};
37 char names5[5][6] = {
"Muon",
"EM_B",
"EM_E",
"HadB",
"HadE"};
40 for (
int i=0; i<n; ++i) {
43 c.setName(names25[i]);
78 for (
unsigned int i=0; i<
m_compVec.size(); ++i) {
85std::string TrigMissingET::getNameOfComponent(
unsigned int index)
const
90 return std::string(
"WRONG INDEX!");
94float TrigMissingET::getExComponent(
unsigned int index)
const{
102float TrigMissingET::getEyComponent(
unsigned int index)
const{
110float TrigMissingET::getEzComponent(
unsigned int index)
const{
118float TrigMissingET::getSumEtComponent(
unsigned int index)
const{
126float TrigMissingET::getSumEComponent(
unsigned int index)
const{
134short TrigMissingET::getSumOfSigns(
unsigned int index)
const{
142unsigned short TrigMissingET::getUsedChannels(
unsigned int index)
const{
150short TrigMissingET::getStatus(
unsigned int index)
const{
158float TrigMissingET::getComponentCalib0(
unsigned int index)
const{
166float TrigMissingET::getComponentCalib1(
unsigned int index)
const{
176void TrigMissingET::setNameOfComponent(
unsigned int index,
const char*
str){
181void TrigMissingET::setExComponent(
unsigned int index,
float value){
186void TrigMissingET::setEyComponent(
unsigned int index,
float value){
191void TrigMissingET::setEzComponent(
unsigned int index,
float value){
196void TrigMissingET::setSumEtComponent(
unsigned int index,
float value){
201void TrigMissingET::setSumEComponent(
unsigned int index,
float value){
206void TrigMissingET::setComponentCalib0(
unsigned int index,
float value){
211void TrigMissingET::setComponentCalib1(
unsigned int index,
float value){
216void TrigMissingET::setSumOfSigns(
unsigned int index,
short value){
221void TrigMissingET::setUsedChannels(
unsigned int index,
unsigned short value){
226void TrigMissingET::setStatus(
unsigned int index,
short value){
236 const double DELTA=1e-3;
238 if(
a.getNumOfComponents() != b.getNumOfComponents() )
240 if(
a.getFlag() != b.getFlag() )
242 if(
a.RoIword() != b.RoIword() )
245 if( fabsf(
a.ex() - b.ex()) >
DELTA )
247 if( fabsf(
a.ey() - b.ey()) >
DELTA )
249 if( fabsf(
a.ez() - b.ez()) >
DELTA )
251 if( fabsf(
a.sumEt() - b.sumEt()) >
DELTA )
253 if( fabsf(
a.sumE() - b.sumE()) >
DELTA )
256 for (
unsigned u=0; u<
a.getNumOfComponents(); ++u) {
257 if(
a.getNameOfComponent(u) != b.getNameOfComponent(u) )
259 if(
a.getStatus(u) != b.getStatus(u) )
261 if(
a.getSumOfSigns(u) != b.getSumOfSigns(u) )
263 if(
a.getUsedChannels(u) != b.getUsedChannels(u) )
265 if( fabsf(
a.getExComponent(u) - b.getExComponent(u)) >
DELTA )
267 if( fabsf(
a.getEyComponent(u) - b.getEyComponent(u)) >
DELTA )
269 if( fabsf(
a.getEzComponent(u) - b.getEzComponent(u)) >
DELTA )
271 if( fabsf(
a.getSumEtComponent(u) - b.getSumEtComponent(u)) >
DELTA )
273 if( fabsf(
a.getSumEComponent(u) - b.getSumEComponent(u)) >
DELTA )
275 if( fabsf(
a.getComponentCalib0(u) - b.getComponentCalib0(u)) >
DELTA )
277 if( fabsf(
a.getComponentCalib1(u) - b.getComponentCalib1(u)) >
DELTA )
294 float et = std::sqrt(
a.ex()*
a.ex()+
a.ey()*
a.ey());
296 s +=
strformat(
"SumEt = %10.2f MeV\n",
a.sumEt());
297 s +=
strformat(
"SumE = %10.2f MeV\n",
a.sumE());
299 s +=
strformat(
"Event status = 0x%08x\n", (
unsigned)
a.getFlag());
300 unsigned int N =
a.getNumOfComponents();
301 s +=
strformat(
"Auxiliary components = %4u\n", N);
306 s +=
"__name_____status__usedCh.__sumOfSigns__calib1_calib0";
307 s +=
"/MeV___Ex/MeV_____Ey/MeV_____Ez/MeV___SumE/MeV__SumEt/MeV\n";
309 for (
unsigned int i=0; i<N; ++i){
311 "%10s 0x%04x %8d %11d %7.2f %8.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
312 a.getNameOfComponent(i).c_str(),
313 (
unsigned)
a.getStatus(i),
314 a.getUsedChannels(i),
316 a.getComponentCalib1(i),
317 a.getComponentCalib0(i),
321 a.getSumEComponent(i),
322 a.getSumEtComponent(i));
330 return ( m <<
str( d ) );
336 std::map<std::string, double>& variableChange){
338 const double DELTA=1e-3;
340 int Na =
a.getNumOfComponents();
341 int Nb = b.getNumOfComponents();
343 variableChange[
"NumOfComponents" ] = Na - Nb;
345 unsigned aFlag = (unsigned)
a.getFlag();
346 unsigned bFlag = (unsigned) b.getFlag();
348 variableChange[
"FlagsXOR" ] = aFlag ^ bFlag;
350 unsigned long aRoI = (
unsigned long)
a.RoIword();
351 unsigned long bRoI = (
unsigned long) b.RoIword();
353 variableChange[
"RoIwordsXOR" ] = aRoI ^ bRoI;
357 if( fabsf(aEx - bEx) >
DELTA )
358 variableChange[
"Ex" ] = aEx - bEx;
362 if( fabsf(aEy - bEy) >
DELTA )
363 variableChange[
"Ey" ] = aEy - bEy;
367 if( fabsf(aEz - bEz) >
DELTA )
368 variableChange[
"Ez" ] = aEz - bEz;
370 float aSumEt =
a.sumEt();
371 float bSumEt = b.sumEt();
372 if( fabsf(aSumEt - bSumEt) >
DELTA )
373 variableChange[
"sumEt" ] = aSumEt - bSumEt;
375 float aSumE =
a.sumE();
376 float bSumE = b.sumE();
377 if( fabsf(aSumE - bSumE) >
DELTA )
378 variableChange[
"sumE" ] = aSumE - bSumE;
380 for (
unsigned u=0; u<
a.getNumOfComponents(); ++u) {
384 if(
a.getNameOfComponent(u) != b.getNameOfComponent(u) ) {
385 key=
"CompNameStrCmp"; key+=num;
386 variableChange[ key.c_str() ] =
387 strcmp(
a.getNameOfComponent(u).c_str(),
388 b.getNameOfComponent(u).c_str());
391 unsigned aFlag = (unsigned)
a.getStatus(u);
392 unsigned bFlag = (unsigned) b.getStatus(u);
393 if( aFlag != bFlag ) {
394 key=
"CompStatusXOR"; key+=num;
395 variableChange[ key.c_str() ] = aFlag ^ bFlag;
398 int aSigns =
a.getSumOfSigns(u);
399 int bSigns = b.getSumOfSigns(u);
400 if( aSigns != bSigns ) {
401 key=
"CompSumSigns"; key+=num;
402 variableChange[ key.c_str() ] = aSigns - bSigns;
405 int aChans =
a.getUsedChannels(u);
406 int bChans = b.getUsedChannels(u);
407 if( aChans != bChans ) {
408 key=
"CompUsedChans"; key+=num;
409 variableChange[ key.c_str() ] = aChans - bChans;
412 float aEx =
a.getExComponent(u);
413 float bEx = b.getExComponent(u);
414 if( fabsf(aEx - bEx) >
DELTA ) {
415 key=
"CompEx"; key+=num;
416 variableChange[ key.c_str() ] = aEx - bEx;
419 float aEy =
a.getEyComponent(u);
420 float bEy = b.getEyComponent(u);
421 if( fabsf(aEy - bEy) >
DELTA ) {
422 key=
"CompEy"; key+=num;
423 variableChange[ key.c_str() ] = aEy - bEy;
426 float aEz =
a.getEzComponent(u);
427 float bEz = b.getEzComponent(u);
428 if( fabsf(aEz - bEz) >
DELTA ) {
429 key=
"CompEz"; key+=num;
430 variableChange[ key.c_str() ] = aEz - bEz;
433 float aSumEt =
a.getSumEtComponent(u);
434 float bSumEt = b.getSumEtComponent(u);
435 if( fabsf(aSumEt - bSumEt) >
DELTA ) {
436 key=
"CompSumEt"; key+=num;
437 variableChange[ key.c_str() ] = aSumEt - bSumEt;
440 float aSumE =
a.getSumEComponent(u);
441 float bSumE = b.getSumEComponent(u);
442 if( fabsf(aSumE - bSumE) >
DELTA ) {
443 key=
"CompSumE"; key+=num;
444 variableChange[ key.c_str() ] = aSumE - bSumE;
447 float aCalib0 =
a.getComponentCalib0(u);
448 float bCalib0 = b.getComponentCalib0(u);
449 if( fabsf(aCalib0 - bCalib0) >
DELTA ) {
450 key=
"CompCalib0_"; key+=num;
451 variableChange[ key.c_str() ] = aCalib0 - bCalib0;
454 float aCalib1 =
a.getComponentCalib1(u);
455 float bCalib1 = b.getComponentCalib1(u);
456 if( fabsf(aCalib1 - bCalib1) >
DELTA ) {
457 key=
"CompCalib1_"; key+=num;
458 variableChange[ key.c_str() ] = aCalib1 - bCalib1;
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
static const double DELTA
bool operator==(const TrigMissingET &a, const TrigMissingET &b)
Operator comparing two objects for equality.
MsgStream & operator<<(MsgStream &m, const TrigMissingET &d)
void diff(const TrigMissingET &a, const TrigMissingET &b, std::map< std::string, double > &variableChange)
Comparison with feedback.
Class for LVL2/EF MissingET trigger.
float m_ez
Basic information: Ez component.
float m_sum_et
Basic information: scalar sum of Et.
float m_ex
Basic information: Ex component.
void clear()
reset contents
float m_sum_e
Basic information: scalar sum of E.
int m_flag
Basic information: event status flag: 0 (default) means OK.
long m_roiWord
Basic information: RoIword.
TrigMissingET()=default
default constructor
std::vector< TrigMissingEtComponent > m_compVec
Auxiliary information: components from different calo layers and muons.
float m_ey
Basic information: Ey component.
MET trigger slice components (auxiliary information for TrigMissingET).
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Extra patterns decribing particle interation process.