#include "TrigMissingEtEvent/TrigMissingET.h"
#include "TrigMissingEtEvent/TrigMissingEtComponent.h"
#include "CxxUtils/StrFormat.h"
#include <string>
#include <stdio.h>
#include <string.h>
#include <cmath>
Go to the source code of this file.
◆ diff()
Comparison with feedback.
Definition at line 342 of file TrigMissingET.cxx.
345 const double DELTA=1
e-3;
347 int Na =
a.getNumOfComponents();
348 int Nb =
b.getNumOfComponents();
350 variableChange[
"NumOfComponents" ] = Na - Nb;
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) ) {
393 variableChange[
key.c_str() ] =
394 strcmp(
a.getNameOfComponent(
u).c_str(),
395 b.getNameOfComponent(
u).c_str());
400 if( aFlag != bFlag ) {
402 variableChange[
key.c_str() ] = aFlag ^ bFlag;
405 int aSigns =
a.getSumOfSigns(
u);
406 int bSigns =
b.getSumOfSigns(
u);
407 if( aSigns != bSigns ) {
409 variableChange[
key.c_str() ] = aSigns - bSigns;
412 int aChans =
a.getUsedChannels(
u);
413 int bChans =
b.getUsedChannels(
u);
414 if( aChans != bChans ) {
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 ) {
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 ) {
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 ) {
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 ) {
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 ) {
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 ) {
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 ) {
465 variableChange[
key.c_str() ] = aCalib1 - bCalib1;
◆ operator<<()
◆ operator==()
Operator comparing two objects for equality.
Definition at line 241 of file TrigMissingET.cxx.
243 const double DELTA=1
e-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 )
◆ str()
conversion to formatted string: multi-line!
Definition at line 292 of file TrigMissingET.cxx.
301 float et = std::sqrt(
a.ex()*
a.ex()+
a.ey()*
a.ey());
306 s +=
strformat(
"Event status = 0x%08x\n", (
unsigned)
a.getFlag());
307 unsigned int N =
a.getNumOfComponents();
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));