diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h index cfd63ed5b83a2e39ba4c4ba2db188a088ddae413..1f35c1ae8fd558ca51ea0a9cc47460273c11536c 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl1.h @@ -28,10 +28,10 @@ namespace TCS { parType_t p_NumberLeading1 = { 0 }; parType_t p_NumberLeading2 = { 0 }; - parType_t p_DeltaEtaMin[3] = {0, 0, 0}; - parType_t p_DeltaEtaMax[3] = {0, 0, 0}; - parType_t p_MinET1 = { 0 }; - parType_t p_MinET2 = { 0 }; + parType_t p_DeltaEtaMin[4] = {0, 0, 0,0}; + parType_t p_DeltaEtaMax[4] = {0, 0, 0,0}; + parType_t p_MinET1[4] = { 0,0,0,0 }; + parType_t p_MinET2[4] = { 0,0,0,0 }; }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h index 50f287832446c16015cf091b85cf2d6f33890fec..9ffd6952696b9ff1650767d81274b9e4d696a885 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaEtaIncl2.h @@ -28,10 +28,10 @@ namespace TCS { parType_t p_NumberLeading1 = { 0 }; parType_t p_NumberLeading2 = { 0 }; - parType_t p_DeltaEtaMin[3] = {0, 0, 0}; - parType_t p_DeltaEtaMax[3] = {0, 0, 0}; - parType_t p_MinET1 = { 0 }; - parType_t p_MinET2 = { 0 }; + parType_t p_DeltaEtaMin[4] = {0, 0, 0,0}; + parType_t p_DeltaEtaMax[4] = {0, 0, 0,0}; + parType_t p_MinET1[4] = { 0,0,0,0 }; + parType_t p_MinET2[4] = { 0,0,0,0 }; }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h index 37b27c8680c870279f7150406beeac087de07639..ac83c8008709e36fab8df68d42558985d16992d5 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DeltaRSqrIncl1.h @@ -32,7 +32,7 @@ namespace TCS { parType_t p_DeltaRMax[3] = {0, 0, 0}; parType_t p_MinET1 = { 0 }; parType_t p_MinET2 = { 0 }; - + parType_t p_OneBarrel = { 0 }; }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl2.h new file mode 100644 index 0000000000000000000000000000000000000000..7b46865febd89646830c10cd17d728f625835d60 --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl2.h @@ -0,0 +1,45 @@ +// DisambiguationDRIncl2.h +// TopoCore +// Created by Joerg Stelzer on 11/16/12. +// Copyright (c) 2012 Joerg Stelzer. All rights reserved. + +#ifndef __TopoCore__DisambiguationDRIncl2__ +#define __TopoCore__DisambiguationDRIncl2__ + +#include <iostream> +#include "L1TopoInterfaces/DecisionAlg.h" + +namespace TCS { + + class DisambiguationDRIncl2 : public DecisionAlg { + public: + DisambiguationDRIncl2(const std::string & name); + virtual ~DisambiguationDRIncl2(); + + virtual StatusCode initialize(); + + + virtual StatusCode process( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, + Decision & decison ); + + + private: + + parType_t p_NumberLeading1 = { 0 }; + parType_t p_NumberLeading2 = { 0 }; + parType_t p_MinET1 = { 0 }; + parType_t p_MinET2 = { 0 }; + parType_t p_EtaMin1 = { 0 }; + parType_t p_EtaMax1 = { 0 }; + parType_t p_EtaMin2 = { 0 }; + parType_t p_EtaMax2 = { 0 }; + parType_t p_DRCutMin = { 0 }; + parType_t p_DRCutMax = { 0 }; + + + }; + +} + +#endif diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl3.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl3.h index 53eea5eb86ee9e0e47c2b73ec4bf659a84f24fa7..ef0e1669c133e51c46587f1e416dc1603f40fbfc 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl3.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDRIncl3.h @@ -28,6 +28,7 @@ namespace TCS { parType_t p_NumberLeading1 = { 0 }; parType_t p_NumberLeading2 = { 0 }; + parType_t p_NumberLeading3 = { 0 }; parType_t p_DisambDR[2] = {0, 0}; parType_t p_MinET1 = { 0 }; parType_t p_MinET2 = { 0 }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDetaDPhiIncl3.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDetaDPhiIncl3.h new file mode 100644 index 0000000000000000000000000000000000000000..2e2ee8d5a9f412933235ac6a2442a50a0a007299 --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationDetaDPhiIncl3.h @@ -0,0 +1,52 @@ +// DisambiguationDetaDPhiIncl3.h +// TopoCore +// Created by Joerg Stelzer on 11/16/12. +// Copyright (c) 2012 Joerg Stelzer. All rights reserved. + +#ifndef __TopoCore__DisambiguationDetaDPhiIncl3__ +#define __TopoCore__DisambiguationDetaDPhiIncl3__ + +#include <iostream> +#include "L1TopoInterfaces/DecisionAlg.h" + +namespace TCS { + + class DisambiguationDetaDPhiIncl3 : public DecisionAlg { + public: + DisambiguationDetaDPhiIncl3(const std::string & name); + virtual ~DisambiguationDetaDPhiIncl3(); + + virtual StatusCode initialize(); + + + virtual StatusCode process( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, + Decision & decison ); + + + private: + + parType_t p_NumberLeading1 = { 0 }; + parType_t p_NumberLeading2 = { 0 }; + parType_t p_NumberLeading3 = { 0 }; + parType_t p_DisambDR[2] = {0, 0}; + parType_t p_MinET1 = { 0 }; + parType_t p_MinET2 = { 0 }; + parType_t p_MinET3 = { 0 }; + parType_t p_EtaMin1 = { 0 }; + parType_t p_EtaMax1 = { 0 }; + parType_t p_EtaMin2 = { 0 }; + parType_t p_EtaMax2 = { 0 }; + parType_t p_EtaMin3 = { 0 }; + parType_t p_EtaMax3 = { 0 }; + parType_t p_DeltaPhiMin = { 0 }; + parType_t p_DeltaPhiMax = { 0 }; + parType_t p_DeltaEtaMin = { 0 }; + parType_t p_DeltaEtaMax = { 0 }; + + + }; + +} + +#endif diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationIncl3.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationIncl3.h index f39eaad4afcbf103233a830c2316306b01dd2eb7..0cbba74bd4bf316837ff348bdebc7ee25d370917 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationIncl3.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/DisambiguationIncl3.h @@ -28,6 +28,7 @@ namespace TCS { parType_t p_NumberLeading1 = { 0 }; parType_t p_NumberLeading2 = { 0 }; + parType_t p_NumberLeading3 = { 0 }; parType_t p_DisambDR[2] = {0, 0}; parType_t p_MinET1 = { 0 }; parType_t p_MinET2 = { 0 }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h index c9c34ea5382523ee0123b40432874bcbe097e4fc..41ad161458c0e4c64b7dd7737e594903ef70212f 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive1.h @@ -28,10 +28,10 @@ namespace TCS { parType_t p_NumberLeading1 = { 0 }; parType_t p_NumberLeading2 = { 0 }; - parType_t p_InvMassMin[3] = {0, 0, 0}; - parType_t p_InvMassMax[3] = {0, 0, 0}; - parType_t p_MinET1 = { 0 }; - parType_t p_MinET2 = { 0 }; + parType_t p_InvMassMin[6] = {0, 0, 0,0,0,0}; + parType_t p_InvMassMax[6] = {0, 0, 0,0,0,0}; + parType_t p_MinET1[4] = { 0 ,0,0,0}; + parType_t p_MinET2[4] = { 0 ,0,0,0}; }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h index ad60e8894d4fb2b4f1149ef14db29ad4d054a005..a36016212a3ff22363ace38bffbb311796078839 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/InvariantMassInclusive2.h @@ -28,10 +28,10 @@ namespace TCS { parType_t p_NumberLeading1 = { 0 }; parType_t p_NumberLeading2 = { 0 }; - parType_t p_InvMassMin[3] = {0, 0, 0}; - parType_t p_InvMassMax[3] = {0, 0, 0}; - parType_t p_MinET1 = { 0 }; - parType_t p_MinET2 = { 0 }; + parType_t p_InvMassMin[6] = {0, 0, 0,0,0,0}; + parType_t p_InvMassMax[6] = {0, 0, 0,0,0,0}; + parType_t p_MinET1[6] = { 0,0,0,0,0,0 }; + parType_t p_MinET2[6] = { 0,0,0,0,0,0 }; }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h index d07a1e745306bc48ad38949cade84d3c2311be3b..07ac34be33b5425daf1231ed76bb39dec266e44b 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/JetHT.h @@ -29,7 +29,7 @@ namespace TCS { parType_t p_MinET = { 0 }; parType_t p_EtaMin = { 0 }; parType_t p_EtaMax = { 49 }; - parType_t p_HT[2] = { 0 , 0 }; + parType_t p_HT[6] = { 0 , 0,0,0,0,0 }; }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/RatioSum.h b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/RatioSum.h index fc7b678f55b294c536342f0fec5e90f0c93dcd36..0fa0686a926256ac8270eaecd012188bd51a4419 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/RatioSum.h +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/L1TopoAlgorithms/RatioSum.h @@ -26,6 +26,7 @@ namespace TCS { private: parType_t p_NumberLeading1 = { 0 }; + parType_t p_NumberLeading2 = { 0 }; parType_t p_MinET1 = { 0 }; parType_t p_EtaMin1 = { 0 }; parType_t p_EtaMax1 = { 49 }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx index 66823dc876c6e73895e73e14e530d220e846531a..d5cc21d5a652dd5fedceef0966a4de994f698472 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl1.cxx @@ -35,12 +35,27 @@ namespace { TCS::DeltaEtaIncl1::DeltaEtaIncl1(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth", 0); - defineParameter("NumResultBits", 1); - defineParameter("MinEt1",0); - defineParameter("MinEt2",0); + defineParameter("MaxTob", 0); + defineParameter("NumResultBits", 4); + defineParameter("MinEt1",0,0); + defineParameter("MinEt2",0,0); + defineParameter("MinEt1",0,1); + defineParameter("MinEt2",0,1); + defineParameter("MinEt1",0,2); + defineParameter("MinEt2",0,2); + defineParameter("MinEt1",0,3); + defineParameter("MinEt2",0,3); + defineParameter("MinDeltaEta", 0, 0); defineParameter("MaxDeltaEta", 127, 0); - setNumberOutputBits(1); + defineParameter("MinDeltaEta", 0, 1); + defineParameter("MaxDeltaEta", 127, 1); + defineParameter("MinDeltaEta", 0, 2); + defineParameter("MaxDeltaEta", 127, 2); + defineParameter("MinDeltaEta", 0, 3); + defineParameter("MaxDeltaEta", 127, 3); + + setNumberOutputBits(4); } TCS::DeltaEtaIncl1::~DeltaEtaIncl1(){} @@ -48,22 +63,31 @@ TCS::DeltaEtaIncl1::~DeltaEtaIncl1(){} TCS::StatusCode TCS::DeltaEtaIncl1::initialize() { - p_NumberLeading1 = parameter("InputWidth").value(); - p_NumberLeading2 = parameter("InputWidth").value(); - for(int i=0; i<1; ++i) { + + if(parameter("MaxTob").value() > 0) { + p_NumberLeading1 = parameter("MaxTob").value(); + p_NumberLeading2 = parameter("MaxTob").value(); + } else { + p_NumberLeading1 = parameter("InputWidth").value(); + p_NumberLeading2 = parameter("InputWidth").value(); + } + + for(unsigned int i=0; i<numberOutputBits(); ++i) { p_DeltaEtaMin[i] = parameter("MinDeltaEta", i).value(); p_DeltaEtaMax[i] = parameter("MaxDeltaEta", i).value(); + + p_MinET1[i] = parameter("MinEt1",i).value(); + p_MinET2[i] = parameter("MinEt2",i).value(); } - p_MinET1 = parameter("MinEt1").value(); - p_MinET2 = parameter("MinEt2").value(); - TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); // note that the reading of generic parameters doesn't work yet TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); - TRG_MSG_INFO("DeltaEtaMin0 : " << p_DeltaEtaMin[0]); - TRG_MSG_INFO("DeltaEtaMax0 : " << p_DeltaEtaMax[0]); - TRG_MSG_INFO("MinET1 : " << p_MinET1); - TRG_MSG_INFO("MinET2 : " << p_MinET2); + for(unsigned int i=0; i<numberOutputBits(); ++i) { + TRG_MSG_INFO("DeltaEtaMin0 : " << p_DeltaEtaMin[i]); + TRG_MSG_INFO("DeltaEtaMax0 : " << p_DeltaEtaMax[i]); + TRG_MSG_INFO("MinET1 : " << p_MinET1[i]); + TRG_MSG_INFO("MinET2 : " << p_MinET2[i]); + } TRG_MSG_INFO("number output : " << numberOutputBits()); return StatusCode::SUCCESS; @@ -84,20 +108,24 @@ TCS::DeltaEtaIncl1::process( const std::vector<TCS::TOBArray const *> & input, unsigned int nLeading = p_NumberLeading1; unsigned int nLeading2 = p_NumberLeading2; - for( TOBArray::const_iterator tob1 = input[0]->begin(); + + for( TOBArray::const_iterator tob1 = input[0]->begin(); tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < nLeading; ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1 ) continue; // ET cut TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < nLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + bool accept[4]; + for(unsigned int i=0; i < numberOutputBits(); ++i) { + if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; // DeltaEta cuts unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 ); @@ -105,19 +133,18 @@ TCS::DeltaEtaIncl1::process( const std::vector<TCS::TOBArray const *> & input, msgss << "Combination : " << distance( input[0]->begin(), tob1) << " x " << distance( input[0]->begin(), tob2) << " eta=" << (*tob1)->eta() << " , eta=" << (*tob2)->eta() << ", DeltaEta = " << deltaEta << " -> "; - bool accept[1]; - for(unsigned int i=0; i < numberOutputBits(); ++i) { - accept[i] = deltaEta >= p_DeltaEtaMin[i] && deltaEta <= p_DeltaEtaMax[i]; - if( accept[i] ) { + + accept[i] = deltaEta >= p_DeltaEtaMin[i] && deltaEta <= p_DeltaEtaMax[i]; + if( accept[i] ) { decison.setBit(i, true); output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); - } - msgss << (accept[i]?"pass":"fail") << "|"; } - TRG_MSG_DEBUG(msgss.str()); - } + msgss << (accept[i]?"pass":"fail") << "|"; + + TRG_MSG_DEBUG(msgss.str()); + } } - + } } else { diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx index eb9369843e15fa90221d5d5f24a17b521f40c2ac..ce4ba5f274903cf60843030ecbda7bc30dac347e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaEtaIncl2.cxx @@ -36,12 +36,27 @@ TCS::DeltaEtaIncl2::DeltaEtaIncl2(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth1", 0); defineParameter("InputWidth2", 0); - defineParameter("NumResultBits", 1); - defineParameter("MinEt1",0); - defineParameter("MinEt2",0); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); + defineParameter("NumResultBits", 4); + defineParameter("MinEt1",0,0); + defineParameter("MinEt2",0,0); + defineParameter("MinEt1",0,1); + defineParameter("MinEt2",0,1); + defineParameter("MinEt1",0,2); + defineParameter("MinEt2",0,2); + defineParameter("MinEt1",0,3); + defineParameter("MinEt2",0,3); defineParameter("MinDeltaEta", 0, 0); defineParameter("MaxDeltaEta", 127, 0); - setNumberOutputBits(1); + defineParameter("MinDeltaEta", 0, 1); + defineParameter("MaxDeltaEta", 127, 1); + defineParameter("MinDeltaEta", 0, 2); + defineParameter("MaxDeltaEta", 127, 2); + defineParameter("MinDeltaEta", 0, 3); + defineParameter("MaxDeltaEta", 127, 3); + + setNumberOutputBits(4); } TCS::DeltaEtaIncl2::~DeltaEtaIncl2(){} @@ -51,20 +66,25 @@ TCS::StatusCode TCS::DeltaEtaIncl2::initialize() { p_NumberLeading1 = parameter("InputWidth1").value(); p_NumberLeading2 = parameter("InputWidth2").value(); - for(int i=0; i<1; ++i) { + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + + for(unsigned int i=0; i<numberOutputBits(); ++i) { p_DeltaEtaMin[i] = parameter("MinDeltaEta", i).value(); p_DeltaEtaMax[i] = parameter("MaxDeltaEta", i).value(); - } - p_MinET1 = parameter("MinEt1").value(); - p_MinET2 = parameter("MinEt2").value(); - + + p_MinET1[i] = parameter("MinEt1",i).value(); + p_MinET2[i] = parameter("MinEt2",i).value(); + } TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); // note that the reading of generic parameters doesn't work yet TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); - TRG_MSG_INFO("DeltaEtaMin0 : " << p_DeltaEtaMin[0]); - TRG_MSG_INFO("DeltaEtaMax0 : " << p_DeltaEtaMax[0]); - TRG_MSG_INFO("MinET1 : " << p_MinET1); - TRG_MSG_INFO("MinET2 : " << p_MinET2); + for(unsigned int i=0; i<numberOutputBits(); ++i) { + TRG_MSG_INFO("DeltaEtaMin0 : " << p_DeltaEtaMin[i]); + TRG_MSG_INFO("DeltaEtaMax0 : " << p_DeltaEtaMax[i]); + TRG_MSG_INFO("MinET1 : " << p_MinET1[i]); + TRG_MSG_INFO("MinET2 : " << p_MinET2[i]); + } TRG_MSG_INFO("number output : " << numberOutputBits()); return StatusCode::SUCCESS; @@ -86,28 +106,28 @@ TCS::DeltaEtaIncl2::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) <= p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut // test DeltaEtaMin, DeltaEtaMax unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 ); - bool accept[1]; - for(unsigned int i=0; i<1; ++i) { + bool accept[4]; + for(unsigned int i=0; i<numberOutputBits(); ++i) { + if( parType_t((*tob1)->Et()) <= p_MinET1[i]) continue; // ET cut + if( parType_t((*tob2)->Et()) <= p_MinET2[i]) continue; // ET cut accept[i] = deltaEta >= p_DeltaEtaMin[i] && deltaEta <= p_DeltaEtaMax[i]; if( accept[i] ) { decison.setBit(i, true); output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); } - } - TRG_MSG_DEBUG("DeltaEta = " << deltaEta << " -> " - << (accept[0]?"pass":"fail")); - + + TRG_MSG_DEBUG("DeltaEta = " << deltaEta << " -> accept bit " << i << " -> " + << (accept[i]?"pass":"fail")); + } } } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx index 40467b0dd9067fd9c241b6ab3f17612867605579..61b72a00562ef9701b462f87c542260c738dbe66 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl1.cxx @@ -34,6 +34,7 @@ namespace { TCS::DeltaPhiIncl1::DeltaPhiIncl1(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth", 0); + defineParameter("MaxTob", 0); defineParameter("NumResultBits", 1); defineParameter("MinEt1",0); defineParameter("MinEt2",0); @@ -47,8 +48,15 @@ TCS::DeltaPhiIncl1::~DeltaPhiIncl1(){} TCS::StatusCode TCS::DeltaPhiIncl1::initialize() { - p_NumberLeading1 = parameter("InputWidth").value(); - p_NumberLeading2 = parameter("InputWidth").value(); + + if(parameter("MaxTob").value() > 0) { + p_NumberLeading1 = parameter("MaxTob").value(); + p_NumberLeading2 = parameter("MaxTob").value(); + } else { + p_NumberLeading1 = parameter("InputWidth").value(); + p_NumberLeading2 = parameter("InputWidth").value(); + } + for(int i=0; i<1; ++i) { p_DeltaPhiMin[i] = parameter("MinDeltaPhi", i).value(); p_DeltaPhiMax[i] = parameter("MaxDeltaPhi", i).value(); @@ -87,14 +95,15 @@ TCS::DeltaPhiIncl1::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1 ) continue; // ET cut - + if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < nLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; // DeltaPhi cuts unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx index 97a26a6410388f859161aafc0d239f7cf7c74546..f10cbcb79a4f5f9b02e6d0e809aef40c3e2789c1 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaPhiIncl2.cxx @@ -33,8 +33,10 @@ namespace { TCS::DeltaPhiIncl2::DeltaPhiIncl2(const std::string & name) : DecisionAlg(name) { - defineParameter("InputWidth1", 0); - defineParameter("InputWidth2", 0); + defineParameter("InputWidth1", 8); + defineParameter("InputWidth2", 8); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 1); defineParameter("MinEt1",0); defineParameter("MinEt2",0); @@ -50,6 +52,8 @@ TCS::StatusCode TCS::DeltaPhiIncl2::initialize() { p_NumberLeading1 = parameter("InputWidth1").value(); p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); for(int i=0; i<1; ++i) { p_DeltaPhiMin[i] = parameter("MinDeltaPhi", i).value(); p_DeltaPhiMax[i] = parameter("MaxDeltaPhi", i).value(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx index 2752c6b9a647e13bdc3716bed32b96e9fda46ceb..6db94b67d36f7292d97fc5d18d8ee935035254c1 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl1.cxx @@ -39,8 +39,7 @@ namespace { TCS::DeltaRApproxBoxCutIncl1::DeltaRApproxBoxCutIncl1(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth", 3); defineParameter("NumResultBits", 3); defineParameter("DeltaPhiMin", 0, 0); defineParameter("DeltaPhiMax", 63, 0); @@ -64,8 +63,8 @@ TCS::DeltaRApproxBoxCutIncl1::~DeltaRApproxBoxCutIncl1(){} TCS::StatusCode TCS::DeltaRApproxBoxCutIncl1::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth").value(); + p_NumberLeading2 = parameter("InputWidth").value(); for(int i=0; i<3; ++i) { p_DeltaPhiMin[i] = parameter("DeltaPhiMin", i).value(); p_DeltaPhiMax[i] = parameter("DeltaPhiMax", i).value(); @@ -116,14 +115,15 @@ TCS::DeltaRApproxBoxCutIncl1::process( const std::vector<TCS::TOBArray const *> ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1 ) continue; // ET cut - + if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; // DeltaPhi cuts unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx index f71db3ed766f7bf2d82314758ac2a025696af93c..b848b1aab4fab49a9f6a1487bdec5826086dd833 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRApproxBoxCutIncl2.cxx @@ -38,8 +38,8 @@ namespace { TCS::DeltaRApproxBoxCutIncl2::DeltaRApproxBoxCutIncl2(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 5); + defineParameter("InputWidth2", 3); defineParameter("NumResultBits", 3); defineParameter("DeltaPhiMin", 0, 0); defineParameter("DeltaPhiMax", 63, 0); @@ -63,8 +63,8 @@ TCS::DeltaRApproxBoxCutIncl2::~DeltaRApproxBoxCutIncl2(){} TCS::StatusCode TCS::DeltaRApproxBoxCutIncl2::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); for(int i=0; i<3; ++i) { p_DeltaPhiMin[i] = parameter("DeltaPhiMin", i).value(); p_DeltaPhiMax[i] = parameter("DeltaPhiMax", i).value(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx index fb12d9af11531adb6896002090da31029895c8ee..d35e832964db9e31da735f98e66d4ca6322d520e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl1.cxx @@ -40,9 +40,10 @@ namespace { TCS::DeltaRSqrIncl1::DeltaRSqrIncl1(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth", 9); + defineParameter("MaxTob", 0); defineParameter("NumResultBits", 3); + defineParameter("RequireOneBarrel", 0); defineParameter("DeltaRMin", 0, 0); defineParameter("DeltaRMax", 0, 0); defineParameter("DeltaRMin", 0, 1); @@ -59,8 +60,15 @@ TCS::DeltaRSqrIncl1::~DeltaRSqrIncl1(){} TCS::StatusCode TCS::DeltaRSqrIncl1::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + if(parameter("MaxTob").value() > 0) { + p_NumberLeading1 = parameter("MaxTob").value(); + p_NumberLeading2 = parameter("MaxTob").value(); + } else { + p_NumberLeading1 = parameter("InputWidth").value(); + p_NumberLeading2 = parameter("InputWidth").value(); + } + p_OneBarrel = parameter("RequireOneBarrel").value(); + for(int i=0; i<3; ++i) { p_DeltaRMin[i] = parameter("DeltaRMin", i).value(); p_DeltaRMax[i] = parameter("DeltaRMax", i).value(); @@ -70,6 +78,8 @@ TCS::DeltaRSqrIncl1::initialize() { TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); + TRG_MSG_INFO("RequireOneBarrel : " << p_OneBarrel); + for(int i=0; i<3; ++i) { TRG_MSG_INFO("DeltaRMin : " << p_DeltaRMin[i]); TRG_MSG_INFO("DeltaRMax : " << p_DeltaRMax[i]); @@ -99,15 +109,19 @@ TCS::DeltaRSqrIncl1::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1 ) continue; // ET cut + if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; + + // OneBarrel + if (p_OneBarrel && parType_t(abs((*tob1)->eta())) > 10 && parType_t(abs((*tob2)->eta())) > 10 ) continue; // DeltaR2 cuts unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx index 7967fff72ca81b526e9a77dd9ecea739d59e0a88..661d19759d945da4c99fb463f69802d964443a45 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DeltaRSqrIncl2.cxx @@ -40,8 +40,10 @@ namespace { TCS::DeltaRSqrIncl2::DeltaRSqrIncl2(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 3); defineParameter("DeltaRMin", 0, 0); defineParameter("DeltaRMax", 0, 0); @@ -59,8 +61,12 @@ TCS::DeltaRSqrIncl2::~DeltaRSqrIncl2(){} TCS::StatusCode TCS::DeltaRSqrIncl2::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + for(int i=0; i<3; ++i) { p_DeltaRMin[i] = parameter("DeltaRMin", i).value(); p_DeltaRMax[i] = parameter("DeltaRMax", i).value(); @@ -98,13 +104,13 @@ TCS::DeltaRSqrIncl2::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { - if( parType_t((*tob1)->Et()) < p_MinET1) continue; // ET cut + if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) < p_MinET2) continue; // ET cut + if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut // test DeltaR2Min, DeltaR2Max unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a647a181bc62cd0a73f2b078b8047e1070c9b42d --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl2.cxx @@ -0,0 +1,160 @@ +/********************************* + * DisambiguationDRIncl2.cpp + * Created by Joerg Stelzer / V Sorin on 9/16/14. + * Copyright (c) 2012 Joerg Stelzer. All rights reserved. + * + * @brief algorithm calculates the dR distance between objects in two lists, + * but minimum value uses > instead of >= as dr algos + * + * @param NumberLeading +**********************************/ + +#include <cmath> + +#include "L1TopoAlgorithms/DisambiguationDRIncl2.h" +#include "L1TopoCommon/Exception.h" +#include "L1TopoInterfaces/Decision.h" + +REGISTER_ALG_TCS(DisambiguationDRIncl2) + +using namespace std; + +// not the best solution but we will move to athena where this comes for free +#define LOG cout << "TCS::DisambiguationDRIncl2: " + + + + +namespace { + unsigned int + calcDeltaR2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double deta = ( tob1->etaDouble() - tob2->etaDouble() ); + double dphi = fabs( tob1->phiDouble() - tob2->phiDouble() ); + if(dphi>M_PI) + dphi = 2*M_PI - dphi; + + return round ( 100 * ((dphi)*(dphi) + (deta)*(deta) )) ; + + } +} + + +TCS::DisambiguationDRIncl2::DisambiguationDRIncl2(const std::string & name) : DecisionAlg(name) +{ + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); + defineParameter("NumResultBits", 2); + defineParameter("MinET1",1); + defineParameter("MinET2",1); + defineParameter("MinET3",1); + defineParameter("EtaMin1",0); + defineParameter("EtaMax1",49); + defineParameter("EtaMin2",0); + defineParameter("EtaMax2",49); + defineParameter("EtaMin3",0); + defineParameter("EtaMax3",49); + defineParameter("DRCutMin",0); + defineParameter("DRCutMax",0); + defineParameter("DisambDR",0,0); + defineParameter("DisambDR",0,1); + setNumberOutputBits(2); +} + +TCS::DisambiguationDRIncl2::~DisambiguationDRIncl2(){} + + +TCS::StatusCode +TCS::DisambiguationDRIncl2::initialize() { + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + + + p_MinET1 = parameter("MinET1").value(); + p_MinET2 = parameter("MinET2").value(); + p_EtaMin1 = parameter("EtaMin1").value(); + p_EtaMax1 = parameter("EtaMax1").value(); + p_EtaMin2 = parameter("EtaMin2").value(); + p_EtaMax2 = parameter("EtaMax2").value(); + p_DRCutMin = parameter("DRCutMin").value(); + p_DRCutMax = parameter("DRCutMax").value(); + + + + + TRG_MSG_INFO("MinET1 : " << p_MinET1); + TRG_MSG_INFO("EtaMin1 : " << p_EtaMin1); + TRG_MSG_INFO("EtaMax1 : " << p_EtaMax1); + TRG_MSG_INFO("MinET2 : " << p_MinET2); + TRG_MSG_INFO("EtaMin2 : " << p_EtaMin2); + TRG_MSG_INFO("EtaMax2 : " << p_EtaMax2); + TRG_MSG_INFO("DRCutMin : " << p_DRCutMin); + TRG_MSG_INFO("DRCutMax : " << p_DRCutMax); + TRG_MSG_INFO("number output : " << numberOutputBits()); + + + return StatusCode::SUCCESS; +} + + + +TCS::StatusCode +TCS::DisambiguationDRIncl2::process( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, + Decision & decision ) +{ + + + if( input.size() == 2) { + + + for( TOBArray::const_iterator tob1 = input[0]->begin(); + tob1 != input[0]->end() && distance(input[0]->begin(), tob1) < p_NumberLeading1; + ++tob1) + { + + if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut + if( parType_t(fabs((*tob1)->eta())) > p_EtaMax1 ) continue; // Eta cut + if( parType_t(fabs((*tob1)->eta())) < p_EtaMin1 ) continue; // Eta cut + + for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); + tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2; + ++tob2) { + + if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + if( parType_t(fabs((*tob2)->eta())) > p_EtaMax2 ) continue; // Eta cut + if( parType_t(fabs((*tob2)->eta())) < p_EtaMin2 ) continue; // Eta cut + + // test DeltaR2Min, DeltaR2Max + unsigned int deltaR2Cut = calcDeltaR2( *tob1, *tob2 ); + + + bool accept[3]; + for(unsigned int i=0; i<numberOutputBits(); ++i) { + accept[i] = deltaR2Cut > p_DRCutMin*p_DRCutMin && deltaR2Cut <= p_DRCutMax*p_DRCutMax ; + + if( accept[i] ) { + decision.setBit(i, true); + output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); + } + TRG_MSG_DEBUG("Decision " << i << ": " << (accept[i]?"pass":"fail") << " deltaR = " << deltaR2Cut ); + + + } + + } + + + + } + + } else { + + TCS_EXCEPTION("DisambiguationDRIncl2 alg must have 2 inputs, but got " << input.size()); + + } + return TCS::StatusCode::SUCCESS; +} diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx index a90c691d9d98b97fb83d37d180db6b5da2abd4a8..adde47209851af44f570f27e70017d40a79e219e 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDRIncl3.cxx @@ -41,8 +41,12 @@ namespace { TCS::DisambiguationDRIncl3::DisambiguationDRIncl3(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("InputWidth3", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); + defineParameter("MaxTob3", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",1); defineParameter("MinET2",1); @@ -65,8 +69,15 @@ TCS::DisambiguationDRIncl3::~DisambiguationDRIncl3(){} TCS::StatusCode TCS::DisambiguationDRIncl3::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + p_NumberLeading3 = parameter("InputWidth3").value(); + + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + if(parameter("MaxTob3").value() > 0) p_NumberLeading3 = parameter("MaxTob3").value(); + + p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_MinET3 = parameter("MinET3").value(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx new file mode 100644 index 0000000000000000000000000000000000000000..7cdf44652017b5bb554ff5abaa3ab084cbdd3436 --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationDetaDPhiIncl3.cxx @@ -0,0 +1,216 @@ +/********************************* + * DisambiguationDetaDPhiIncl3.cpp + * Created by Joerg Stelzer / V Sorin on 9/16/14. + * Copyright (c) 2012 Joerg Stelzer. All rights reserved. + * + * @brief algorithm calculates the dR distance between objects in three lists, check EM vs TAU , if those not match + * check agains 3rd object, passed if no match with 3rd + * + * @param NumberLeading +**********************************/ + +#include <cmath> + +#include "L1TopoAlgorithms/DisambiguationDetaDPhiIncl3.h" +#include "L1TopoCommon/Exception.h" +#include "L1TopoInterfaces/Decision.h" + +REGISTER_ALG_TCS(DisambiguationDetaDPhiIncl3) + +using namespace std; + +// not the best solution but we will move to athena where this comes for free +#define LOG cout << "TCS::DisambiguationDetaDPhiIncl3: " + + + +namespace { + unsigned int + calcDeltaPhi(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double dphi = fabs( tob1->phiDouble() - tob2->phiDouble() ); + if(dphi>M_PI) + dphi = 2*M_PI - dphi; + + return round( 10 * dphi ); + } + + unsigned int + calcDeltaEta(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double deta = fabs( tob1->eta() - tob2->eta() ); + return deta; + } + + unsigned int + calcDeltaR2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double deta = ( tob1->etaDouble() - tob2->etaDouble() ); + double dphi = fabs( tob1->phiDouble() - tob2->phiDouble() ); + if(dphi>M_PI) + dphi = 2*M_PI - dphi; + + return round ( 100 * ((dphi)*(dphi) + (deta)*(deta) )) ; + + } + +} + + + +TCS::DisambiguationDetaDPhiIncl3::DisambiguationDetaDPhiIncl3(const std::string & name) : DecisionAlg(name) +{ + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("InputWidth3", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); + defineParameter("MaxTob3", 0); + defineParameter("NumResultBits", 2); + defineParameter("MinET1",1); + defineParameter("MinET2",1); + defineParameter("MinET3",1); + defineParameter("EtaMin1",0); + defineParameter("EtaMax1",49); + defineParameter("EtaMin2",0); + defineParameter("EtaMax2",49); + defineParameter("EtaMin3",0); + defineParameter("EtaMax3",49); + defineParameter("DeltaPhiMin", 0); + defineParameter("DeltaPhiMax", 64); + defineParameter("DeltaEtaMin", 0); + defineParameter("DeltaEtaMax", 99); + defineParameter("DisambDR",0,0); + defineParameter("DisambDR",0,1); + setNumberOutputBits(2); +} + +TCS::DisambiguationDetaDPhiIncl3::~DisambiguationDetaDPhiIncl3(){} + + +TCS::StatusCode +TCS::DisambiguationDetaDPhiIncl3::initialize() { + + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + p_NumberLeading3 = parameter("InputWidth3").value(); + + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + if(parameter("MaxTob3").value() > 0) p_NumberLeading3 = parameter("MaxTob3").value(); + + + p_MinET1 = parameter("MinET1").value(); + p_MinET2 = parameter("MinET2").value(); + p_MinET3 = parameter("MinET3").value(); + p_EtaMin1 = parameter("EtaMin1").value(); + p_EtaMax1 = parameter("EtaMax1").value(); + p_EtaMin2 = parameter("EtaMin2").value(); + p_EtaMax2 = parameter("EtaMax2").value(); + p_EtaMin3 = parameter("EtaMin3").value(); + p_EtaMax3 = parameter("EtaMax3").value(); + p_DeltaPhiMin = parameter("DeltaPhiMin").value(); + p_DeltaPhiMax = parameter("DeltaPhiMax").value(); + p_DeltaEtaMin = parameter("DeltaEtaMin").value(); + p_DeltaEtaMax = parameter("DeltaEtaMax").value(); + + + for(int i=0; i<2; ++i) { + p_DisambDR[i] = parameter("DisambDR", i).value(); + } + + + + TRG_MSG_INFO("MinET1 : " << p_MinET1); + TRG_MSG_INFO("EtaMin1 : " << p_EtaMin1); + TRG_MSG_INFO("EtaMax1 : " << p_EtaMax1); + TRG_MSG_INFO("MinET2 : " << p_MinET2); + TRG_MSG_INFO("EtaMin2 : " << p_EtaMin2); + TRG_MSG_INFO("EtaMax2 : " << p_EtaMax2); + TRG_MSG_INFO("MinET3 : " << p_MinET3); + TRG_MSG_INFO("EtaMin3 : " << p_EtaMin3); + TRG_MSG_INFO("EtaMax3 : " << p_EtaMax3); + TRG_MSG_INFO("DisambDR0 : " << p_DisambDR[0]); + TRG_MSG_INFO("DisambDR1 : " << p_DisambDR[1]); + TRG_MSG_INFO("DeltaPhimin : " << p_DeltaPhiMin); + TRG_MSG_INFO("DeltaPhimin : " << p_DeltaPhiMax); + TRG_MSG_INFO("DeltaEtamin : " << p_DeltaEtaMin); + TRG_MSG_INFO("DeltaEtamin : " << p_DeltaEtaMax); + + TRG_MSG_INFO("number output : " << numberOutputBits()); + + + return StatusCode::SUCCESS; +} + + + +TCS::StatusCode +TCS::DisambiguationDetaDPhiIncl3::process( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, + Decision & decision ) +{ + + + if( input.size() == 3) { + + + for( TOBArray::const_iterator tob1 = input[0]->begin(); + tob1 != input[0]->end() && distance(input[0]->begin(), tob1) < p_NumberLeading1; + ++tob1) + { + + if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut + if( parType_t(fabs((*tob1)->eta())) > p_EtaMax1 ) continue; // Eta cut + if( parType_t(fabs((*tob1)->eta())) < p_EtaMin1 ) continue; // Eta cut + + for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); + tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2; + ++tob2) { + + if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + if( parType_t(fabs((*tob2)->eta())) > p_EtaMax2 ) continue; // Eta cut + if( parType_t(fabs((*tob2)->eta())) < p_EtaMin2 ) continue; // Eta cut + + // DeltaPhi cuts + unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 ); + // DeltaEta cuts + unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 ); + + if(deltaPhi > p_DeltaPhiMax || deltaEta > p_DeltaEtaMax) continue; + if (deltaEta < p_DeltaEtaMin && deltaPhi < p_DeltaPhiMin ) continue; + + for( TCS::TOBArray::const_iterator tob3 = input[2]->begin(); + tob3 != input[2]->end() ; + ++tob3) { + + if( parType_t((*tob3)->Et()) <= p_MinET3) continue; // ET cut + if( parType_t(fabs((*tob3)->eta())) > p_EtaMax3 ) continue; // Eta cut + if( parType_t(fabs((*tob3)->eta())) < p_EtaMin3 ) continue; // Eta cut + + unsigned int deltaR13 = calcDeltaR2( *tob1, *tob3 ); + unsigned int deltaR23 = calcDeltaR2( *tob2, *tob3 ); + + bool accept[3]; + for(unsigned int i=0; i<numberOutputBits(); ++i) { + accept[i] = deltaR13 > p_DisambDR[i]*p_DisambDR[i] && deltaR23 > p_DisambDR[i]*p_DisambDR[i] ; + if( accept[i] ) { + decision.setBit(i, true); + output[i]->push_back(TCS::CompositeTOB(*tob1, *tob2)); + } + TRG_MSG_DEBUG("Decision " << i << ": " << (accept[i]?"pass":"fail") << " deltaR13 = " << deltaR13 << " deltaR23 = " << deltaR23); + + } + + } + + + + + } + } + + } else { + + TCS_EXCEPTION("DisambiguationDetaDPhiIncl3 alg must have 3 inputs, but got " << input.size()); + + } + return TCS::StatusCode::SUCCESS; +} diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx index 5017165843553678a0af8726ed0936c57da860c3..5ea2deb1882932a4f3de88b21fe6ae0444065be4 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl2.cxx @@ -40,8 +40,10 @@ namespace { TCS::DisambiguationIncl2::DisambiguationIncl2(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",1); defineParameter("MinET2",1); @@ -59,8 +61,11 @@ TCS::DisambiguationIncl2::~DisambiguationIncl2(){} TCS::StatusCode TCS::DisambiguationIncl2::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_EtaMin1 = parameter("EtaMin1").value(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx index 41188d816c215b5b89fca7dee5d15579a756b692..c3ba0b29fe9c493ef727d4932f392c82e2b6cfce 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/DisambiguationIncl3.cxx @@ -40,8 +40,12 @@ namespace { TCS::DisambiguationIncl3::DisambiguationIncl3(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("InputWidth3", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); + defineParameter("MaxTob3", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",1); defineParameter("MinET2",1); @@ -62,8 +66,15 @@ TCS::DisambiguationIncl3::~DisambiguationIncl3(){} TCS::StatusCode TCS::DisambiguationIncl3::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + p_NumberLeading3 = parameter("InputWidth3").value(); + + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + if(parameter("MaxTob3").value() > 0) p_NumberLeading3 = parameter("MaxTob3").value(); + + p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_MinET3 = parameter("MinET3").value(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/GenericListGenerator.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/GenericListGenerator.cxx index c9ffc87ef4c702c0e29841722a2e6939fb4a11f7..f2ad5e6f1fe8a85ef29bcfdbeca3534f7f904e01 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/GenericListGenerator.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/GenericListGenerator.cxx @@ -10,6 +10,7 @@ #include "L1TopoEvent/JetTOBArray.h" #include "L1TopoEvent/GenericTOB.h" #include <algorithm> +#include <typeinfo> REGISTER_ALG_TCS(GenericListGenerator) diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx index e04b4c58a23091d4754c236c76075292d3674ff8..40ad765934879118d9e855fad01e36a40e90c397 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive1.cxx @@ -42,18 +42,31 @@ namespace { TCS::InvariantMassInclusive1::InvariantMassInclusive1(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 6); - defineParameter("NumberLeading2", 6); - defineParameter("NumResultBits", 3); - defineParameter("InvMassMin", 0, 0); - defineParameter("InvMassMax", 999, 0); - defineParameter("InvMassMin", 0, 1); - defineParameter("InvMassMax", 999, 1); - defineParameter("InvMassMin", 0, 2); - defineParameter("InvMassMax", 999, 2); - defineParameter("MinET1",1); - defineParameter("MinET2",1); - setNumberOutputBits(3); + defineParameter("InputWidth", 3); + defineParameter("MaxTob", 0); + defineParameter("NumResultBits", 6); + defineParameter("MinMSqr", 0, 0); + defineParameter("MaxMSqr", 999, 0); + defineParameter("MinMSqr", 0, 1); + defineParameter("MaxMSqr", 999, 1); + defineParameter("MinMSqr", 0, 2); + defineParameter("MaxMSqr", 999, 2); + defineParameter("MinMSqr", 0, 3); + defineParameter("MaxMSqr", 999, 3); + defineParameter("MinMSqr", 0, 4); + defineParameter("MaxMSqr", 999, 4); + defineParameter("MinMSqr", 0, 5); + defineParameter("MaxMSqr", 999, 5); + defineParameter("MinET1",0,0); + defineParameter("MinET2",0,0); + defineParameter("MinET1",0,1); + defineParameter("MinET2",0,1); + defineParameter("MinET1",0,2); + defineParameter("MinET2",0,2); + defineParameter("MinET1",0,3); + defineParameter("MinET2",0,3); + + setNumberOutputBits(6); } TCS::InvariantMassInclusive1::~InvariantMassInclusive1(){} @@ -61,25 +74,31 @@ TCS::InvariantMassInclusive1::~InvariantMassInclusive1(){} TCS::StatusCode TCS::InvariantMassInclusive1::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); - for(int i=0; i<3; ++i) { - p_InvMassMin[i] = parameter("InvMassMin", i).value(); - p_InvMassMax[i] = parameter("InvMassMax", i).value(); + if(parameter("MaxTob").value() > 0) { + p_NumberLeading1 = parameter("MaxTob").value(); + p_NumberLeading2 = parameter("MaxTob").value(); + } else { + p_NumberLeading1 = parameter("InputWidth").value(); + p_NumberLeading2 = parameter("InputWidth").value(); } - p_MinET1 = parameter("MinET1").value(); - p_MinET2 = parameter("MinET2").value(); + for(unsigned int i=0; i<numberOutputBits(); ++i) { + p_InvMassMin[i] = parameter("MinMSqr", i).value(); + p_InvMassMax[i] = parameter("MaxMSqr", i).value(); + + p_MinET1[i] = parameter("MinET1",i).value(); + p_MinET2[i] = parameter("MinET2",i).value(); + } TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); - for(int i=0; i<3; ++i) { + for(unsigned int i=0; i<numberOutputBits(); ++i) { TRG_MSG_INFO("InvMassMin : " << p_InvMassMin[i]); TRG_MSG_INFO("InvMassMax : " << p_InvMassMax[i]); + + TRG_MSG_INFO("MinET1 : " << p_MinET1[i]); + TRG_MSG_INFO("MinET2 : " << p_MinET2[i]); } - TRG_MSG_INFO("MinET1 : " << p_MinET1); - TRG_MSG_INFO("MinET2 : " << p_MinET2); - TRG_MSG_INFO("number output : " << numberOutputBits()); return StatusCode::SUCCESS; @@ -102,23 +121,26 @@ TCS::InvariantMassInclusive1::process( const std::vector<TCS::TOBArray const *> ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1 ) continue; // ET cut - + TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut // Inv Mass calculation unsigned int invmass2 = calcInvMass( *tob1, *tob2 ); - bool accept[3]; + bool accept[6]; for(unsigned int i=0; i<numberOutputBits(); ++i) { - accept[i] = invmass2 >= p_InvMassMin[i]*p_InvMassMin[i] && invmass2 <= p_InvMassMax[i]*p_InvMassMax[i]; // to-do : confirm that param is InvM, and not sq + if( parType_t((*tob1)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( parType_t((*tob2)->Et()) <= min(p_MinET1[i],p_MinET2[i])) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= max(p_MinET1[i],p_MinET2[i]))) continue; + + + accept[i] = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i]; // if( accept[i] ) { decison.setBit(i, true); output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx index 73c07ef2b74419e4074b67f2a63ee402ed8534ed..46df23d1c9271eaa640c4afe743d158bd3eee9ef 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/InvariantMassInclusive2.cxx @@ -42,18 +42,37 @@ namespace { TCS::InvariantMassInclusive2::InvariantMassInclusive2(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 6); - defineParameter("NumberLeading2", 6); - defineParameter("NumResultBits", 3); - defineParameter("InvMassMin", 0, 0); - defineParameter("InvMassMax", 999, 0); - defineParameter("InvMassMin", 0, 1); - defineParameter("InvMassMax", 999, 1); - defineParameter("InvMassMin", 0, 2); - defineParameter("InvMassMax", 999, 2); - defineParameter("MinET1",0); - defineParameter("MinET2",0); - setNumberOutputBits(3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); + defineParameter("NumResultBits", 6); + defineParameter("MinMSqr", 0, 0); + defineParameter("MaxMSqr", 999, 0); + defineParameter("MinMSqr", 0, 1); + defineParameter("MaxMSqr", 999, 1); + defineParameter("MinMSqr", 0, 2); + defineParameter("MaxMSqr", 999, 2); + defineParameter("MinMSqr", 0, 3); + defineParameter("MaxMSqr", 999, 3); + defineParameter("MinMSqr", 0, 4); + defineParameter("MaxMSqr", 999, 4); + defineParameter("MinMSqr", 0, 5); + defineParameter("MaxMSqr", 999, 5); + defineParameter("MinET1",0,0); + defineParameter("MinET2",0,0); + defineParameter("MinET1",0,1); + defineParameter("MinET2",0,1); + defineParameter("MinET1",0,2); + defineParameter("MinET2",0,2); + defineParameter("MinET1",0,3); + defineParameter("MinET2",0,3); + defineParameter("MinET1",0,4); + defineParameter("MinET2",0,4); + defineParameter("MinET1",0,5); + defineParameter("MinET2",0,5); + + setNumberOutputBits(6); } TCS::InvariantMassInclusive2::~InvariantMassInclusive2(){} @@ -61,24 +80,27 @@ TCS::InvariantMassInclusive2::~InvariantMassInclusive2(){} TCS::StatusCode TCS::InvariantMassInclusive2::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); - for(int i=0; i<3; ++i) { - p_InvMassMin[i] = parameter("InvMassMin", i).value(); - p_InvMassMax[i] = parameter("InvMassMax", i).value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + + for(unsigned int i=0; i<numberOutputBits(); ++i) { + p_InvMassMin[i] = parameter("MinMSqr", i).value(); + p_InvMassMax[i] = parameter("MaxMSqr", i).value(); + + p_MinET1[i] = parameter("MinET1",i).value(); + p_MinET2[i] = parameter("MinET2",i).value(); } - p_MinET1 = parameter("MinET1").value(); - p_MinET2 = parameter("MinET2").value(); - TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1); TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2); - for(int i=0; i<3; ++i) { + for(unsigned int i=0; i<numberOutputBits(); ++i) { TRG_MSG_INFO("InvMassMin : " << p_InvMassMin[i]); TRG_MSG_INFO("InvMassMax : " << p_InvMassMax[i]); + TRG_MSG_INFO("MinET1 : " << p_MinET1[i]); + TRG_MSG_INFO("MinET2 : " << p_MinET2[i]); } - TRG_MSG_INFO("MinET1 : " << p_MinET1); - TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("number output : " << numberOutputBits()); @@ -101,22 +123,24 @@ TCS::InvariantMassInclusive2::process( const std::vector<TCS::TOBArray const *> ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1) continue; // ET cut for( TCS::TOBArray::const_iterator tob2 = input[1]->begin(); tob2 != input[1]->end() && distance(input[1]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut // Inv Mass calculation unsigned int invmass2 = calcInvMass( *tob1, *tob2 ); - bool accept[3]; + bool accept[6]; for(unsigned int i=0; i<numberOutputBits(); ++i) { - accept[i] = invmass2 >= p_InvMassMin[i]*p_InvMassMin[i] && invmass2 <= p_InvMassMax[i]*p_InvMassMax[i]; // to-do : confirm that param is InvM, and not sq + if( parType_t((*tob1)->Et()) <= p_MinET1[i]) continue; // ET cut + if( parType_t((*tob2)->Et()) <= p_MinET2[i]) continue; // ET cut + + + accept[i] = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i]; if( accept[i] ) { decison.setBit(i, true); output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx index ad6cfb2b2e7cb19e387947889baadc3749b7a3a2..c8e94552f594413f611cef36ae8faf0cea8c8d1b 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetHT.cxx @@ -26,12 +26,19 @@ using namespace std; TCS::JetHT::JetHT(const std::string & name) : DecisionAlg(name) { defineParameter("InputWidth", 0); - defineParameter("NumResultBits",1); + defineParameter("MaxTob", 0); + defineParameter("NumResultBits",6); + defineParameter("NumRegisters", 2); defineParameter("MinEt",0); defineParameter("MinEta",0); defineParameter("MaxEta",31); defineParameter("MinHt",0,0); - setNumberOutputBits(1); + defineParameter("MinHt",0,1); + defineParameter("MinHt",0,2); + defineParameter("MinHt",0,3); + defineParameter("MinHt",0,4); + defineParameter("MinHt",0,5); + setNumberOutputBits(6); } TCS::JetHT::~JetHT() @@ -41,13 +48,16 @@ TCS::JetHT::~JetHT() TCS::StatusCode TCS::JetHT::initialize() { p_NumberLeading1 = parameter("InputWidth").value(); + if(parameter("MaxTob").value() > 0) p_NumberLeading1 = parameter("MaxTob").value(); p_MinET = parameter("MinEt").value(); p_EtaMin = parameter("MinEta").value(); p_EtaMax = parameter("MaxEta").value(); + + TRG_MSG_INFO("MaxTob : " << p_NumberLeading1); TRG_MSG_INFO("MinET : " << p_MinET); TRG_MSG_INFO("EtaMin : " << p_EtaMin); TRG_MSG_INFO("EtaMax : " << p_EtaMax); - for(int i=0; i<1; ++i) { + for(unsigned int i=0; i<numberOutputBits(); ++i) { p_HT[i] = parameter("MinHt", i).value(); TRG_MSG_INFO("HT " << i << " : " << p_HT[i]); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx index 5500be855d35f8e4ee5d75287f00528df16ac1d3..0a7229b57c963db36986c45ec2e371dca6e40214 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/JetMatch.cxx @@ -25,7 +25,8 @@ using namespace std; TCS::JetMatch::JetMatch(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); + defineParameter("InputWidth", 3); + defineParameter("MaxTob", 0); defineParameter("NumResultBits", 1); defineParameter("MinET1",0); defineParameter("MinET2",0); @@ -40,11 +41,14 @@ TCS::JetMatch::~JetMatch() TCS::StatusCode TCS::JetMatch::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); + p_NumberLeading1 = parameter("InputWidth").value(); + if(parameter("MaxTob").value() > 0) p_NumberLeading1 = parameter("MaxTob").value(); p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_EtaMin = parameter("EtaMin").value(); p_EtaMax = parameter("EtaMax").value(); + + TRG_MSG_INFO("MaxTob : " << p_NumberLeading1); TRG_MSG_INFO("MinET1 : " << p_MinET1); TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("EtaMin : " << p_EtaMin); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAR.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAR.cxx index d4ac983abcdfba66d871019e7a73c5a327e7509d..f8fd82fa7797e6bdb27ad00b6046e0cb0936ceb6 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAR.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/LAR.cxx @@ -23,7 +23,8 @@ using namespace std; TCS::LAR::LAR(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); + defineParameter("InputWidth", 3); + defineParameter("MaxTob", 0); defineParameter("NumResultBits", 1); defineParameter("PhiMin", 0); defineParameter("PhiMax", 63); @@ -38,7 +39,8 @@ TCS::LAR::~LAR(){} TCS::StatusCode TCS::LAR::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); + p_NumberLeading1 = parameter("InputWidth").value(); + if(parameter("MaxTob").value() > 0) p_NumberLeading1 = parameter("MaxTob").value(); p_PhiMin = parameter("PhiMin").value(); p_PhiMax = parameter("PhiMax").value(); p_EtaMin = parameter("EtaMin").value(); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl1.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl1.cxx index 0b88fb10085ab662b9c2c69833e44285f1f10ca0..002691e720f03a486a7b3aa4ac7341492ca94c51 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl1.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl1.cxx @@ -39,8 +39,8 @@ namespace { TCS::MinDPhiIncl1::MinDPhiIncl1(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth", 3); + defineParameter("MaxTob", 0); defineParameter("NumResultBits", 3); defineParameter("DeltaPhiMin", 0, 0); defineParameter("DeltaPhiMin", 0, 1); @@ -54,8 +54,14 @@ TCS::MinDPhiIncl1::~MinDPhiIncl1(){} TCS::StatusCode TCS::MinDPhiIncl1::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + if(parameter("MaxTob").value() > 0) { + p_NumberLeading1 = parameter("MaxTob").value(); + p_NumberLeading2 = parameter("MaxTob").value(); + } else { + p_NumberLeading1 = parameter("InputWidth").value(); + p_NumberLeading2 = parameter("InputWidth").value(); + } + for(int i=0; i<3; ++i) { p_DeltaPhiMin[i] = parameter("DeltaPhiMin", i).value(); } @@ -100,14 +106,15 @@ TCS::MinDPhiIncl1::process( const std::vector<TCS::TOBArray const *> & input, ++tob1) { - if( parType_t((*tob1)->Et()) <= p_MinET1 ) continue; // ET cut - + if( parType_t((*tob1)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + TCS::TOBArray::const_iterator tob2 = tob1; ++tob2; for( ; tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2; ++tob2) { - if( parType_t((*tob2)->Et()) <= p_MinET2) continue; // ET cut + if( parType_t((*tob2)->Et()) <= min(p_MinET1,p_MinET2)) continue; // ET cut + if( (parType_t((*tob1)->Et()) <= max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= max(p_MinET1,p_MinET2))) continue; // DeltaPhi cuts unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl2.cxx index 6c4e3b82fff29ba8a3665b6f1b59e3687a285ed0..5013dcab76062d9bc3ef973bd059a09a26789d46 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/MinDPhiIncl2.cxx @@ -39,8 +39,10 @@ namespace { TCS::MinDPhiIncl2::MinDPhiIncl2(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 3); defineParameter("DeltaPhiMin", 0, 0); defineParameter("DeltaPhiMin", 0, 1); @@ -55,8 +57,11 @@ TCS::MinDPhiIncl2::~MinDPhiIncl2(){} TCS::StatusCode TCS::MinDPhiIncl2::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + for(int i=0; i<3; ++i) { p_DeltaPhiMin[i] = parameter("DeltaPhiMin", i).value(); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NoMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NoMatch.cxx index 2d0ce9fab8fd72065a8b1ca4404d502cd42b065a..14e302e0428a7aa42884c0292d89657c09682039 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NoMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/NoMatch.cxx @@ -40,8 +40,10 @@ namespace { TCS::NoMatch::NoMatch(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 1); defineParameter("MinET1",1); defineParameter("MinET2",1); @@ -58,8 +60,11 @@ TCS::NoMatch::~NoMatch(){} TCS::StatusCode TCS::NoMatch::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_EtaMin1 = parameter("EtaMin1").value(); @@ -68,6 +73,8 @@ TCS::NoMatch::initialize() { p_EtaMax2 = parameter("EtaMax2").value(); p_DRCut = parameter("DRCut").value(); + TRG_MSG_INFO("Maxtob 1 : " << p_NumberLeading1); + TRG_MSG_INFO("Maxtob 2 : " << p_NumberLeading2); TRG_MSG_INFO("MinET1 : " << p_MinET1); TRG_MSG_INFO("EtaMin1 : " << p_EtaMin1); TRG_MSG_INFO("EtaMax1 : " << p_EtaMax1); @@ -127,7 +134,7 @@ TCS::NoMatch::process( const std::vector<TCS::TOBArray const *> & input, bool accept = matched?false:true ; - decision.setBit( i, accept ); + if (accept) decision.setBit( i, accept ); if(accept) output[i]->push_back( TCS::CompositeTOB(*tob1)); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx index 3bc39be501a51b8c41403a6efdacd14e731e2796..ea3b9665c7e74342a84cbdf2d32ab9e5d3f79635 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio.cxx @@ -25,6 +25,10 @@ using namespace std; TCS::Ratio::Ratio(const std::string & name) : DecisionAlg(name) { + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",0); defineParameter("MinET2",0); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx index 389cc4b9067b49c79f30d58885eb0aa395819721..ba9ae8c2104e8b213d8df45b82d5e1edb54d6aff 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/Ratio2.cxx @@ -24,7 +24,11 @@ using namespace std; TCS::Ratio2::Ratio2(const std::string & name) : DecisionAlg(name) -{ +{ + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",0); defineParameter("MinET2",0); diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx index 089f9de41e03a3236a303e69bbd68840c963e64f..44edddcfd7089968a237afa0521dccc469b49028 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioMatch.cxx @@ -38,8 +38,10 @@ namespace { TCS::RatioMatch::RatioMatch(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); - defineParameter("NumberLeading2", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",0); defineParameter("MinET2",0); @@ -57,13 +59,20 @@ TCS::RatioMatch::~RatioMatch() TCS::StatusCode TCS::RatioMatch::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); - p_NumberLeading2 = parameter("NumberLeading2").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); + p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_EtaMin = parameter("EtaMin").value(); p_EtaMax = parameter("EtaMax").value(); p_DeltaR = parameter("DeltaR").value(); + + + TRG_MSG_INFO("Maxtob 1 : " << p_NumberLeading1); + TRG_MSG_INFO("Maxtob 2 : " << p_NumberLeading2); TRG_MSG_INFO("MinET1 : " << p_MinET1); TRG_MSG_INFO("MinET2 : " << p_MinET2); TRG_MSG_INFO("EtaMin : " << p_EtaMin); @@ -122,10 +131,10 @@ TCS::RatioMatch::process( const std::vector<TCS::TOBArray const *> & input, TRG_MSG_DEBUG("Decision " << i << ": " << (accept[i]?"pass":"fail") << " deltaR2 = " << deltaR2 ); } - } - } + } + } return TCS::StatusCode::SUCCESS; diff --git a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx index 5dce4ccf919f31f3390a44a55db648fce180409b..d8274556a1953777e6ee55e7766074bd315cffde 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoAlgorithms/Root/RatioSum.cxx @@ -25,7 +25,10 @@ using namespace std; TCS::RatioSum::RatioSum(const std::string & name) : DecisionAlg(name) { - defineParameter("NumberLeading1", 3); + defineParameter("InputWidth1", 9); + defineParameter("InputWidth2", 9); + defineParameter("MaxTob1", 0); + defineParameter("MaxTob2", 0); defineParameter("NumResultBits", 2); defineParameter("MinET1",0); defineParameter("MinET2",0); @@ -48,7 +51,10 @@ TCS::RatioSum::~RatioSum() TCS::StatusCode TCS::RatioSum::initialize() { - p_NumberLeading1 = parameter("NumberLeading1").value(); + p_NumberLeading1 = parameter("InputWidth1").value(); + p_NumberLeading2 = parameter("InputWidth2").value(); + if(parameter("MaxTob1").value() > 0) p_NumberLeading1 = parameter("MaxTob1").value(); + if(parameter("MaxTob2").value() > 0) p_NumberLeading2 = parameter("MaxTob2").value(); p_MinET1 = parameter("MinET1").value(); p_MinET2 = parameter("MinET2").value(); p_EtaMin1 = parameter("EtaMin1").value(); @@ -56,6 +62,9 @@ TCS::RatioSum::initialize() { p_EtaMin2 = parameter("EtaMin2").value(); p_EtaMax2 = parameter("EtaMax2").value(); + + TRG_MSG_INFO("Maxtob 1 : " << p_NumberLeading1); + TRG_MSG_INFO("Maxtob 2 : " << p_NumberLeading2); TRG_MSG_INFO("MinET1 : " << p_MinET1); TRG_MSG_INFO("EtaMin1 : " << p_EtaMin1); TRG_MSG_INFO("EtaMax1 : " << p_EtaMax1);