27 char names25[25][6] = {
"EMB0",
"EMB1",
"EMB2",
"EMB3",
28 "EME0",
"EME1",
"EME2",
"EME3",
29 "HEC0",
"HEC1",
"HEC2",
"HEC3",
30 "TiB0",
"TiB1",
"TiB2",
31 "TiG1",
"TiG2",
"TiG3",
32 "TiE0",
"TiE1",
"TiE2",
33 "FCa0",
"FCa1",
"FCa2",
37 char names1[1][6] = {
"Muon"};
40 char names3[3][6] = {
"Muon",
"E.M.",
"Had."};
43 char names5[5][6] = {
"Muon",
"EM_B",
"EM_E",
"HadB",
"HadE"};
46 for (
int i=0; i<n; ++i) {
49 c.setName(names25[i]);
85 for (
unsigned int i=0; i<
m_compVec.size(); ++i) {
97 return std::string(
"WRONG INDEX!");
243 const double DELTA=1e-3;
245 if(
a.getNumOfComponents() != b.getNumOfComponents() )
247 if(
a.getFlag() != b.getFlag() )
249 if(
a.RoIword() != b.RoIword() )
252 if( fabsf(
a.ex() - b.ex()) >
DELTA )
254 if( fabsf(
a.ey() - b.ey()) >
DELTA )
256 if( fabsf(
a.ez() - b.ez()) >
DELTA )
258 if( fabsf(
a.sumEt() - b.sumEt()) >
DELTA )
260 if( fabsf(
a.sumE() - b.sumE()) >
DELTA )
263 for (
unsigned u=0; u<
a.getNumOfComponents(); ++u) {
264 if(
a.getNameOfComponent(u) != b.getNameOfComponent(u) )
266 if(
a.getStatus(u) != b.getStatus(u) )
268 if(
a.getSumOfSigns(u) != b.getSumOfSigns(u) )
270 if(
a.getUsedChannels(u) != b.getUsedChannels(u) )
272 if( fabsf(
a.getExComponent(u) - b.getExComponent(u)) >
DELTA )
274 if( fabsf(
a.getEyComponent(u) - b.getEyComponent(u)) >
DELTA )
276 if( fabsf(
a.getEzComponent(u) - b.getEzComponent(u)) >
DELTA )
278 if( fabsf(
a.getSumEtComponent(u) - b.getSumEtComponent(u)) >
DELTA )
280 if( fabsf(
a.getSumEComponent(u) - b.getSumEComponent(u)) >
DELTA )
282 if( fabsf(
a.getComponentCalib0(u) - b.getComponentCalib0(u)) >
DELTA )
284 if( fabsf(
a.getComponentCalib1(u) - b.getComponentCalib1(u)) >
DELTA )
301 float et = std::sqrt(
a.ex()*
a.ex()+
a.ey()*
a.ey());
303 s +=
strformat(
"SumEt = %10.2f MeV\n",
a.sumEt());
304 s +=
strformat(
"SumE = %10.2f MeV\n",
a.sumE());
306 s +=
strformat(
"Event status = 0x%08x\n", (
unsigned)
a.getFlag());
307 unsigned int N =
a.getNumOfComponents();
308 s +=
strformat(
"Auxiliary components = %4u\n", N);
313 s +=
"__name_____status__usedCh.__sumOfSigns__calib1_calib0";
314 s +=
"/MeV___Ex/MeV_____Ey/MeV_____Ez/MeV___SumE/MeV__SumEt/MeV\n";
316 for (
unsigned int i=0; i<N; ++i){
318 "%10s 0x%04x %8d %11d %7.2f %8.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
319 a.getNameOfComponent(i).c_str(),
320 (
unsigned)
a.getStatus(i),
321 a.getUsedChannels(i),
323 a.getComponentCalib1(i),
324 a.getComponentCalib0(i),
328 a.getSumEComponent(i),
329 a.getSumEtComponent(i));
337 return ( m <<
str( d ) );
343 std::map<std::string, double>& variableChange){
345 const double DELTA=1e-3;
347 int Na =
a.getNumOfComponents();
348 int Nb = b.getNumOfComponents();
350 variableChange[
"NumOfComponents" ] = Na - Nb;
352 unsigned aFlag = (unsigned)
a.getFlag();
353 unsigned bFlag = (unsigned) b.getFlag();
355 variableChange[
"FlagsXOR" ] = aFlag ^ bFlag;
357 unsigned long aRoI = (
unsigned long)
a.RoIword();
358 unsigned long bRoI = (
unsigned long) b.RoIword();
360 variableChange[
"RoIwordsXOR" ] = aRoI ^ bRoI;
364 if( fabsf(aEx - bEx) >
DELTA )
365 variableChange[
"Ex" ] = aEx - bEx;
369 if( fabsf(aEy - bEy) >
DELTA )
370 variableChange[
"Ey" ] = aEy - bEy;
374 if( fabsf(aEz - bEz) >
DELTA )
375 variableChange[
"Ez" ] = aEz - bEz;
377 float aSumEt =
a.sumEt();
378 float bSumEt = b.sumEt();
379 if( fabsf(aSumEt - bSumEt) >
DELTA )
380 variableChange[
"sumEt" ] = aSumEt - bSumEt;
382 float aSumE =
a.sumE();
383 float bSumE = b.sumE();
384 if( fabsf(aSumE - bSumE) >
DELTA )
385 variableChange[
"sumE" ] = aSumE - bSumE;
387 for (
unsigned u=0; u<
a.getNumOfComponents(); ++u) {
391 if(
a.getNameOfComponent(u) != b.getNameOfComponent(u) ) {
392 key=
"CompNameStrCmp"; key+=num;
393 variableChange[ key.c_str() ] =
394 strcmp(
a.getNameOfComponent(u).c_str(),
395 b.getNameOfComponent(u).c_str());
398 unsigned aFlag = (unsigned)
a.getStatus(u);
399 unsigned bFlag = (unsigned) b.getStatus(u);
400 if( aFlag != bFlag ) {
401 key=
"CompStatusXOR"; key+=num;
402 variableChange[ key.c_str() ] = aFlag ^ bFlag;
405 int aSigns =
a.getSumOfSigns(u);
406 int bSigns = b.getSumOfSigns(u);
407 if( aSigns != bSigns ) {
408 key=
"CompSumSigns"; key+=num;
409 variableChange[ key.c_str() ] = aSigns - bSigns;
412 int aChans =
a.getUsedChannels(u);
413 int bChans = b.getUsedChannels(u);
414 if( aChans != bChans ) {
415 key=
"CompUsedChans"; key+=num;
416 variableChange[ key.c_str() ] = aChans - bChans;
419 float aEx =
a.getExComponent(u);
420 float bEx = b.getExComponent(u);
421 if( fabsf(aEx - bEx) >
DELTA ) {
422 key=
"CompEx"; key+=num;
423 variableChange[ key.c_str() ] = aEx - bEx;
426 float aEy =
a.getEyComponent(u);
427 float bEy = b.getEyComponent(u);
428 if( fabsf(aEy - bEy) >
DELTA ) {
429 key=
"CompEy"; key+=num;
430 variableChange[ key.c_str() ] = aEy - bEy;
433 float aEz =
a.getEzComponent(u);
434 float bEz = b.getEzComponent(u);
435 if( fabsf(aEz - bEz) >
DELTA ) {
436 key=
"CompEz"; key+=num;
437 variableChange[ key.c_str() ] = aEz - bEz;
440 float aSumEt =
a.getSumEtComponent(u);
441 float bSumEt = b.getSumEtComponent(u);
442 if( fabsf(aSumEt - bSumEt) >
DELTA ) {
443 key=
"CompSumEt"; key+=num;
444 variableChange[ key.c_str() ] = aSumEt - bSumEt;
447 float aSumE =
a.getSumEComponent(u);
448 float bSumE = b.getSumEComponent(u);
449 if( fabsf(aSumE - bSumE) >
DELTA ) {
450 key=
"CompSumE"; key+=num;
451 variableChange[ key.c_str() ] = aSumE - bSumE;
454 float aCalib0 =
a.getComponentCalib0(u);
455 float bCalib0 = b.getComponentCalib0(u);
456 if( fabsf(aCalib0 - bCalib0) >
DELTA ) {
457 key=
"CompCalib0_"; key+=num;
458 variableChange[ key.c_str() ] = aCalib0 - bCalib0;
461 float aCalib1 =
a.getComponentCalib1(u);
462 float bCalib1 = b.getComponentCalib1(u);
463 if( fabsf(aCalib1 - bCalib1) >
DELTA ) {
464 key=
"CompCalib1_"; key+=num;
465 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.
void setSumOfSigns(unsigned int index, short value)
set sum of energy signs for calibration of component ‘index’
void setEzComponent(unsigned int index, float value)
set Ez for component ‘index’
void setUsedChannels(unsigned int index, unsigned short value)
set number of used channels in component ‘index’
unsigned short getUsedChannels(unsigned int index) const
get number of used channes in component ‘index’
~TrigMissingET()
destructor
float m_ez
Basic information: Ez component.
short getStatus(unsigned int index) const
get status flag for component ‘index’
float m_sum_et
Basic information: scalar sum of Et.
float m_ex
Basic information: Ex component.
void setSumEComponent(unsigned int index, float value)
set sum of |E| for component ‘index’
float getEyComponent(unsigned int index) const
get Ey from component ‘index’
void setStatus(unsigned int index, short value)
set status flag of component ‘index’
void clear()
reset contents
std::string getNameOfComponent(unsigned int index) const
get name of component ‘index’
float m_sum_e
Basic information: scalar sum of E.
short getSumOfSigns(unsigned int index) const
get sum of energy signs for calibration of component ‘index’
void setComponentCalib1(unsigned int index, float value)
set scale for calibration of component ‘index’
void setSumEtComponent(unsigned int index, float value)
set sum of |Et| for component ‘index’
int m_flag
Basic information: event status flag: 0 (default) means OK.
float getSumEComponent(unsigned int index) const
get sum of |E| from component ‘index’
long m_roiWord
Basic information: RoIword.
void setExComponent(unsigned int index, float value)
set Ex for component ‘index’
float getExComponent(unsigned int index) const
get Ex from component ‘index’
float getSumEtComponent(unsigned int index) const
get sum of |Et| from component ‘index’
TrigMissingET()
default constructor
void setEyComponent(unsigned int index, float value)
set Ey for component ‘index’
float getComponentCalib0(unsigned int index) const
get constant term for calibration of component ‘index’
float getEzComponent(unsigned int index) const
get Ez from component ‘index’
std::vector< TrigMissingEtComponent > m_compVec
Auxiliary information: components from different calo layers and muons.
void setComponentCalib0(unsigned int index, float value)
set constant term for calibration of component ‘index’
void setNameOfComponent(unsigned int index, const char *str)
set name of component ‘index’
float getComponentCalib1(unsigned int index) const
get scale for calibration of component ‘index’
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.