Skip to content
Snippets Groups Projects
Commit 0e00c9c4 authored by Paula Martinez Suarez's avatar Paula Martinez Suarez Committed by Edward Moyse
Browse files

Add two new L1Topo algorithms

parent 12a06716
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!41657Add two new L1Topo algorithms
Showing with 628 additions and 26 deletions
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// DeltaRSqrIncl1Charge.h
// TopoCore
// Created by Paula Martinez based on DeltaRSqrIncl1 by Joerg Stelzer/V Sorin.
#ifndef L1TOPOALGORITHMS_DELTARSQRINCL1CHARGE_H
#define L1TOPOALGORITHMS_DELTARSQRINCL1CHARGE_H
#include <iostream>
#include "L1TopoInterfaces/DecisionAlg.h"
class TH2;
namespace TCS {
class DeltaRSqrIncl1Charge : public DecisionAlg {
public:
DeltaRSqrIncl1Charge(const std::string & name);
virtual ~DeltaRSqrIncl1Charge();
virtual StatusCode initialize();
virtual StatusCode processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decison );
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_DeltaRMin[3] = {0, 0, 0};
parType_t p_DeltaRMax[3] = {0, 0, 0};
parType_t p_MinET1 = { 0 };
parType_t p_MinET2 = { 0 };
parType_t p_OneBarrel = { 0 };
};
}
#endif
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
// Based on InvariantMassInclusive2 and DeltaPhiIncl2 by Paula Martinez on 11/02/2021. For questions contact atlas-trig-l1topo-algcom@cern.ch. // Based on InvariantMassInclusive2 and DeltaPhiIncl2 by Paula Martinez on 11/02/2021. For questions contact atlas-trig-l1topo-algcom@cern.ch.
// TO DO size of the input list to be possbly refined // TO DO size of the input list to be possbly refined
#ifndef __TopoCore__InvariantMassDeltaPhiInclusive2Charge__ #ifndef L1TOPOALGORITHMS_INVARIANTMASSDELTAPHIINCLUSIVE2CHARGE_H
#define __TopoCore__InvariantMassDeltaPhiInclusive2Charge__ #define L1TOPOALGORITHMS_INVARIANTMASSDELTAPHIINCLUSIVE2CHARGE_H
#include "L1TopoInterfaces/DecisionAlg.h" #include "L1TopoInterfaces/DecisionAlg.h"
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// InvariantMassInclusiveDeltaRSqrIncl1Charge.h
// TopoCore
// Based on InvariantMassInclusiveDeltaRSqrIncl1, InvariantMassInclusive1 and DeltaRSqrIncl1 created by Joerg Stelzer and V Sorin.
// For questions contact atlas-trig-l1topo-algcom@cern.ch.
#ifndef L1TOPOALGORITHMS_INVARIANTMASSINCLUSIVEDELTARSQRINCL1CHARGE_H
#define L1TOPOALGORITHMS_INVARIANTMASSINCLUSIVEDELTARSQRINCL1CHARGE_H
#include "L1TopoInterfaces/DecisionAlg.h"
class TH2;
namespace TCS {
class InvariantMassInclusiveDeltaRSqrIncl1Charge : public DecisionAlg {
public:
InvariantMassInclusiveDeltaRSqrIncl1Charge(const std::string & name);
virtual ~InvariantMassInclusiveDeltaRSqrIncl1Charge();
virtual StatusCode initialize() override final;
virtual StatusCode processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decison ) override final;
virtual StatusCode process( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decison ) override final;
private:
parType_t p_NumberLeading1 = { 0 };
parType_t p_NumberLeading2 = { 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 };
parType_t p_OneBarrel = { 0 };
parType_t p_DeltaRMin[6] = { 0,0,0,0,0,0 };
parType_t p_DeltaRMax[6] = { 0,0,0,0,0,0 };
};
}
#endif
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
// TopoCore // TopoCore
// Created by Paula Martinez based on InvariantMassInclusive1 by Joerg Stelzer on 11/16/12. // Created by Paula Martinez based on InvariantMassInclusive1 by Joerg Stelzer on 11/16/12.
#ifndef __TopoCore__InvariantMassThreeTOBsInclCharge__ #ifndef L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCLCHARGE_H
#define __TopoCore__InvariantMassThreeTOBsInclCharge__ #define L1TOPOALGORITHMS_INVARIANTMASSTHREETOBSINCLCHARGE_H
#include <iostream> #include <iostream>
#include "L1TopoInterfaces/DecisionAlg.h" #include "L1TopoInterfaces/DecisionAlg.h"
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*********************************
* DeltaRSqrIncl1Charge.cxx
* Created by Paula Martinez based on Joerg Stelzer / V Sorin.
*
* @brief algorithm calculates the R2-distance between objects in one list and applies dR criteria
* Events containing a pair of TGC muons with same charge are rejected
*
* @param NumberLeading
**********************************/
#include <cmath>
#include "TH1F.h"
#include "TH2F.h"
#include "L1TopoAlgorithms/DeltaRSqrIncl1Charge.h"
#include "L1TopoCommon/Exception.h"
#include "L1TopoInterfaces/Decision.h"
#include "L1TopoSimulationUtils/Kinematics.h"
REGISTER_ALG_TCS(DeltaRSqrIncl1Charge)
// not the best solution but we will move to athena where this comes for free
#define LOG std::cout << "TCS::DeltaRSqrIncl1Charge: "
TCS::DeltaRSqrIncl1Charge::DeltaRSqrIncl1Charge(const std::string & name) : DecisionAlg(name)
{
defineParameter("InputWidth", 9);
defineParameter("MaxTob", 0);
defineParameter("NumResultBits", 3);
defineParameter("RequireOneBarrel", 0);
defineParameter("MinET1",1);
defineParameter("MinET2",1);
defineParameter("DeltaRMin", 0, 0);
defineParameter("DeltaRMax", 0, 0);
defineParameter("DeltaRMin", 0, 1);
defineParameter("DeltaRMax", 0, 1);
defineParameter("DeltaRMin", 0, 2);
defineParameter("DeltaRMax", 0, 2);
setNumberOutputBits(3);
}
TCS::DeltaRSqrIncl1Charge::~DeltaRSqrIncl1Charge(){}
TCS::StatusCode
TCS::DeltaRSqrIncl1Charge::initialize() {
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(unsigned int i=0; i<numberOutputBits(); ++i) {
p_DeltaRMin[i] = parameter("DeltaRMin", i).value();
p_DeltaRMax[i] = parameter("DeltaRMax", i).value();
}
p_MinET1 = parameter("MinET1").value();
p_MinET2 = parameter("MinET2").value();
TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1);
TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2);
TRG_MSG_INFO("RequireOneBarrel : " << p_OneBarrel);
for(unsigned int i=0; i<numberOutputBits(); ++i) {
TRG_MSG_INFO("DeltaRMin : " << p_DeltaRMin[i]);
TRG_MSG_INFO("DeltaRMax : " << p_DeltaRMax[i]);
}
TRG_MSG_INFO("MinET1 : " << p_MinET1);
TRG_MSG_INFO("MinET2 : " << p_MinET2);
TRG_MSG_INFO("number output : " << numberOutputBits());
// book histograms
for(unsigned int i=0; i<numberOutputBits(); ++i) {
std::string hname_accept = "hDeltaRSqrIncl1Charge_accept_bit"+std::to_string(static_cast<int>(i));
std::string hname_reject = "hDeltaRSqrIncl1Charge_reject_bit"+std::to_string(static_cast<int>(i));
// dR
bookHist(m_histAccept, hname_accept, "DR", 100, std::sqrt(p_DeltaRMin[i]), std::sqrt(p_DeltaRMax[i]));
bookHist(m_histReject, hname_reject, "DR", 100, std::sqrt(p_DeltaRMin[i]), std::sqrt(p_DeltaRMax[i]));
// eta2 vs. eta1
bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, -70, 70, 100, -70, 70);
bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, -70, 70, 100, -70, 70);
}
return StatusCode::SUCCESS;
}
TCS::StatusCode
TCS::DeltaRSqrIncl1Charge::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decision )
{
if(input.size() == 1) {
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()) <= std::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()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut
if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1,p_MinET2))) continue;
// OneBarrel
if (p_OneBarrel && parType_t(std::abs((*tob1)->eta())) > 10 && parType_t(std::abs((*tob2)->eta())) > 10 ) continue;
// DeltaR2 cuts
unsigned int deltaR2 = TSU::Kinematics::calcDeltaR2BW( *tob1, *tob2 );
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName();
int charge1 = (*tob1)->charge();
int charge2 = (*tob2)->charge();
int totalCharge = charge1 + charge2;
bool acceptCharge = true;
if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) {
if ( totalCharge == 0 or totalCharge == 2 ) { acceptCharge = false; }
}
for(unsigned int i=0; i<numberOutputBits(); ++i) {
bool accept = false;
accept = deltaR2 >= p_DeltaRMin[i] && deltaR2 <= p_DeltaRMax[i] && acceptCharge;
const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept);
const bool fillReject = fillHistos() and not fillAccept;
const bool alreadyFilled = decision.bit(i);
if( accept ) {
decision.setBit(i, true);
output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
}
if(fillAccept and not alreadyFilled) {
fillHist1D(m_histAccept[i],std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
} else if(fillReject) {
fillHist1D(m_histReject[i],std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
}
TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " deltaR2 = " << deltaR2);
}
}
}
} else {
TCS_EXCEPTION("DeltaRSqrIncl1Charge alg must have either 1 input, but got " << input.size());
}
return TCS::StatusCode::SUCCESS;
}
TCS::StatusCode
TCS::DeltaRSqrIncl1Charge::process( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decision )
{
if(input.size() == 1) {
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()) <= std::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()) <= std::min(p_MinET1,p_MinET2)) continue; // ET cut
if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1,p_MinET2)) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1,p_MinET2))) continue;
// OneBarrel
if (p_OneBarrel && parType_t(std::abs((*tob1)->eta())) > 10 && parType_t(std::abs((*tob2)->eta())) > 10 ) continue;
// DeltaR2 cuts
unsigned int deltaR2 = TSU::Kinematics::calcDeltaR2( *tob1, *tob2 );
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName();
int charge1 = (*tob1)->charge();
int charge2 = (*tob2)->charge();
int totalCharge = charge1 + charge2;
bool acceptCharge = true;
if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) {
if ( totalCharge == 0 or totalCharge == 2 ) { acceptCharge = false; }
}
for(unsigned int i=0; i<numberOutputBits(); ++i) {
bool accept = false;
accept = deltaR2 >= p_DeltaRMin[i] && deltaR2 <= p_DeltaRMax[i] && acceptCharge;
const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept);
const bool fillReject = fillHistos() and not fillAccept;
const bool alreadyFilled = decision.bit(i);
if( accept ) {
decision.setBit(i, true);
output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
}
if(fillAccept and not alreadyFilled) {
fillHist1D(m_histAccept[i],std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
} else if(fillReject) {
fillHist1D(m_histReject[i],std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
}
TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " deltaR2 = " << deltaR2);
}
}
}
} else {
TCS_EXCEPTION("DeltaRSqrIncl1Charge alg must have either 1 input, but got " << input.size());
}
return TCS::StatusCode::SUCCESS;
}
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
* Based on V Sorin 2014 implementation of InvariantMassInclusive2. For questions contact atlas-trig-l1topo-algcom@cern.ch. * Based on V Sorin 2014 implementation of InvariantMassInclusive2. For questions contact atlas-trig-l1topo-algcom@cern.ch.
* *
* @brief algorithm calculates the sqr of the INVMASS between two lists and applies invmass criteria. For pairs passing the INVMASS cut a further requirement based on DeltaPhi * @brief algorithm calculates the sqr of the INVMASS between two lists and applies invmass criteria. For pairs passing the INVMASS cut a further requirement based on DeltaPhi
* is applied, addressing ATR-19377. Following ATR-19593, an additional cut in the muon charge is required. * is applied, addressing ATR-19377.
* Events containing a pair of TGC muons with same charge are rejected
* *
**********************************/ **********************************/
// TO DO size of the input list to be possbly refined // TO DO size of the input list to be possbly refined
...@@ -131,8 +132,8 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::initialize() { ...@@ -131,8 +132,8 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::initialize() {
std::string hname_rejectCharge = "hInvariantMassDeltaPhiInclusive2Charge_rejectCharge_bit"+std::to_string(static_cast<int>(i)); std::string hname_rejectCharge = "hInvariantMassDeltaPhiInclusive2Charge_rejectCharge_bit"+std::to_string(static_cast<int>(i));
std::string hname_undefCharge = "hInvariantMassDeltaPhiInclusive2Charge_undefCharge_bit"+std::to_string(static_cast<int>(i)); std::string hname_undefCharge = "hInvariantMassDeltaPhiInclusive2Charge_undefCharge_bit"+std::to_string(static_cast<int>(i));
// mass // mass
bookHist(m_histAcceptM, hname_accept, "INVM vs DPHI", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); bookHist(m_histAcceptM, hname_accept, "INVM vs DPHI", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]);
bookHist(m_histRejectM, hname_reject, "INVM vs DPHI", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]); bookHist(m_histRejectM, hname_reject, "INVM vs DPHI", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]), 100, p_DeltaPhiMin[i], p_DeltaPhiMax[i]);
// eta2 vs. eta1 // eta2 vs. eta1
bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2); bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2);
bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2); bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, p_MinEta1, p_MaxEta1, 100, p_MinEta2, p_MaxEta2);
...@@ -171,11 +172,13 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::processBitCorrect( const std::vector ...@@ -171,11 +172,13 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::processBitCorrect( const std::vector
const int eta2 = (*tob2)->eta(); const int eta2 = (*tob2)->eta();
const unsigned int aeta1 = std::abs(eta1); const unsigned int aeta1 = std::abs(eta1);
const unsigned int aeta2 = std::abs(eta2); const unsigned int aeta2 = std::abs(eta2);
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName(); std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName(); std::string sector2 = (*tob2)->sectorName();
int charge1 = (*tob1)->charge(); int charge1 = (*tob1)->charge();
int charge2 = (*tob2)->charge(); int charge2 = (*tob2)->charge();
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
std::string totalCharge = "undef"; std::string totalCharge = "undef";
if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) { if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) {
if ( charge1 + charge2 == 1 ) { totalCharge = "accept"; } if ( charge1 + charge2 == 1 ) { totalCharge = "accept"; }
...@@ -197,10 +200,10 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::processBitCorrect( const std::vector ...@@ -197,10 +200,10 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::processBitCorrect( const std::vector
output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
} }
if(fillAccept and not alreadyFilled) { if(fillAccept and not alreadyFilled) {
fillHist2D(m_histAcceptM[i],sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi)); fillHist2D(m_histAcceptM[i],std::sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi));
fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2); fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2);
} else if(fillReject) { } else if(fillReject) {
fillHist2D(m_histRejectM[i],sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi)); fillHist2D(m_histRejectM[i],std::sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi));
fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2); fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2);
} }
if(fillHistos() and totalCharge == "accept") { if(fillHistos() and totalCharge == "accept") {
...@@ -246,11 +249,13 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::process( const std::vector<TCS::TOBA ...@@ -246,11 +249,13 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::process( const std::vector<TCS::TOBA
const int eta2 = (*tob2)->eta(); const int eta2 = (*tob2)->eta();
const unsigned int aeta1 = std::abs(eta1); const unsigned int aeta1 = std::abs(eta1);
const unsigned int aeta2 = std::abs(eta2); const unsigned int aeta2 = std::abs(eta2);
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName(); std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName(); std::string sector2 = (*tob2)->sectorName();
int charge1 = (*tob1)->charge(); int charge1 = (*tob1)->charge();
int charge2 = (*tob2)->charge(); int charge2 = (*tob2)->charge();
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
std::string totalCharge = "undef"; std::string totalCharge = "undef";
if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) { if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) {
if ( charge1 + charge2 == 1 ) { totalCharge = "accept"; } if ( charge1 + charge2 == 1 ) { totalCharge = "accept"; }
...@@ -271,10 +276,10 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::process( const std::vector<TCS::TOBA ...@@ -271,10 +276,10 @@ TCS::InvariantMassDeltaPhiInclusive2Charge::process( const std::vector<TCS::TOBA
output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) ); output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
} }
if(fillAccept and not alreadyFilled) { if(fillAccept and not alreadyFilled) {
fillHist2D(m_histAcceptM[i],sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi)); fillHist2D(m_histAcceptM[i],std::sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi));
fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2); fillHist2D(m_histAcceptEta1Eta2[i],eta1, eta2);
} else if(fillReject) { } else if(fillReject) {
fillHist2D(m_histRejectM[i],sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi)); fillHist2D(m_histRejectM[i],std::sqrt(static_cast<float>(invmass2)),static_cast<float>(deltaPhi));
fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2); fillHist2D(m_histRejectEta1Eta2[i],eta1, eta2);
} }
if(fillHistos() and totalCharge == "accept") { if(fillHistos() and totalCharge == "accept") {
......
/*
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/*********************************
* Created by Paula Martinez based on V Sorin and Joerg Stelzer.
*
* @brief algorithm calculates the sqr of the INVMASS and DeltaR between one list and applies invmass and deltaR criteria
* Events containing a pair of TGC muons with same charge are rejected
*
* @param NumberLeading
*
* For questions contact atlas-trig-l1topo-algcom@cern.ch.
**********************************/
#include <cmath>
#include <string>
#include <sstream>
#include <vector>
#include "TH1F.h"
#include "TH2F.h"
#include "L1TopoAlgorithms/InvariantMassInclusiveDeltaRSqrIncl1Charge.h"
#include "L1TopoCommon/Exception.h"
#include "L1TopoInterfaces/Decision.h"
// Bitwise implementation utils
#include "L1TopoSimulationUtils/L1TopoDataTypes.h"
#include "L1TopoSimulationUtils/Trigo.h"
#include "L1TopoSimulationUtils/Hyperbolic.h"
#include "L1TopoSimulationUtils/Kinematics.h"
//
REGISTER_ALG_TCS(InvariantMassInclusiveDeltaRSqrIncl1Charge)
TCS::InvariantMassInclusiveDeltaRSqrIncl1Charge::InvariantMassInclusiveDeltaRSqrIncl1Charge(const std::string & name) : DecisionAlg(name)
{
defineParameter("InputWidth", 3);
defineParameter("MaxTob", 0);
defineParameter("NumResultBits", 6);
defineParameter("RequireOneBarrel", 0);
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);
defineParameter("DeltaRMin", 0, 0);
defineParameter("DeltaRMax", 0, 0);
defineParameter("DeltaRMin", 0, 1);
defineParameter("DeltaRMax", 0, 1);
defineParameter("DeltaRMin", 0, 2);
defineParameter("DeltaRMax", 0, 2);
defineParameter("DeltaRMin", 0, 3);
defineParameter("DeltaRMax", 0, 3);
defineParameter("DeltaRMin", 0, 4);
defineParameter("DeltaRMax", 0, 4);
defineParameter("DeltaRMin", 0, 5);
defineParameter("DeltaRMax", 0, 5);
setNumberOutputBits(6);
}
TCS::InvariantMassInclusiveDeltaRSqrIncl1Charge::~InvariantMassInclusiveDeltaRSqrIncl1Charge(){}
TCS::StatusCode
TCS::InvariantMassInclusiveDeltaRSqrIncl1Charge::initialize() {
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();
TRG_MSG_INFO("NumberLeading1 : " << p_NumberLeading1);
TRG_MSG_INFO("NumberLeading2 : " << p_NumberLeading2);
TRG_MSG_INFO("RequireOneBarrel : " << p_OneBarrel);
for(unsigned int i=0; i<numberOutputBits(); ++i) {
p_InvMassMin[i] = parameter("MinMSqr", i).value();
p_InvMassMax[i] = parameter("MaxMSqr", i).value();
p_DeltaRMin[i] = parameter("DeltaRMin", i).value();
p_DeltaRMax[i] = parameter("DeltaRMax", i).value();
p_MinET1[i] = parameter("MinET1",i).value();
p_MinET2[i] = parameter("MinET2",i).value();
TRG_MSG_INFO("InvMassMin "<< i << " : " << p_InvMassMin[i]);
TRG_MSG_INFO("InvMassMax "<< i << " : " << p_InvMassMax[i]);
TRG_MSG_INFO("MinET1 "<< i << " : " << p_MinET1[i]);
TRG_MSG_INFO("MinET2 "<< i << " : " << p_MinET2[i]);
TRG_MSG_INFO("DeltaRMin "<< i << " : " << p_DeltaRMin[i]);
TRG_MSG_INFO("DeltaRMax "<< i << " : " << p_DeltaRMax[i]);
}
TRG_MSG_INFO("number output : " << numberOutputBits());
// book histograms
for(unsigned int i=0; i<numberOutputBits(); ++i) {
std::string hname_accept = "hInvariantMassDeltaRSqrIncl1Charge_accept_bit"+std::to_string(static_cast<int>(i));
std::string hname_reject = "hInvariantMassDeltaRSqrIncl1Charge_reject_bit"+std::to_string(static_cast<int>(i));
// mass
bookHist(m_histAcceptM, hname_accept, "INVM vs DR", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]), 100, p_DeltaRMin[i], p_DeltaRMax[i]);
bookHist(m_histRejectM, hname_reject, "INVM vs DR", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]), 100, p_DeltaRMin[i], p_DeltaRMax[i]);
// eta2 vs. eta1
bookHist(m_histAcceptEta1Eta2, hname_accept, "ETA vs ETA", 100, -70, 70, 100, -70, 70);
bookHist(m_histRejectEta1Eta2, hname_reject, "ETA vs ETA", 100, -70, 70, 100, -70, 70);
}
return StatusCode::SUCCESS;
}
TCS::StatusCode
TCS::InvariantMassInclusiveDeltaRSqrIncl1Charge::processBitCorrect( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decision )
{
if(input.size() == 1) {
for( TOBArray::const_iterator tob1 = input[0]->begin();
tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < p_NumberLeading1;
++tob1)
{
TCS::TOBArray::const_iterator tob2 = tob1; ++tob2;
for( ;
tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2;
++tob2) {
// OneBarrel
if (p_OneBarrel && parType_t(std::abs((*tob1)->eta())) > 10 && parType_t(std::abs((*tob2)->eta())) > 10 ) continue;
// Inv Mass calculation
unsigned int invmass2 = TSU::Kinematics::calcInvMassBW( *tob1, *tob2 );
// test DeltaR2Min, DeltaR2Max
unsigned int deltaR2 = TSU::Kinematics::calcDeltaR2BW( *tob1, *tob2 );
TRG_MSG_DEBUG("Jet1 = " << **tob1 << ", Jet2 = " << **tob2 << ", invmass2 = " << invmass2 << ", deltaR2 = " << deltaR2);
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName();
int charge1 = (*tob1)->charge();
int charge2 = (*tob2)->charge();
int totalCharge = charge1 + charge2;
bool acceptCharge = true;
if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) {
if ( totalCharge == 0 or totalCharge == 2 ) { acceptCharge = false; }
}
for(unsigned int i=0; i<numberOutputBits(); ++i) {
bool accept = false;
if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut
if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut
if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue;
accept = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i] && deltaR2 >= p_DeltaRMin[i] && deltaR2 <= p_DeltaRMax[i] && acceptCharge;
const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept);
const bool fillReject = fillHistos() and not fillAccept;
const bool alreadyFilled = decision.bit(i);
if( accept ) {
decision.setBit(i, true);
output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
}
if(fillAccept and not alreadyFilled) {
fillHist2D(m_histAcceptM[i],std::sqrt(static_cast<float>(invmass2)),std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
} else if(fillReject) {
fillHist2D(m_histRejectM[i],std::sqrt(static_cast<float>(invmass2)),std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
}
TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2 << " deltaR2 = " << deltaR2 );
}
}
}
} else {
TCS_EXCEPTION("InvariantMassInclusiveDeltaRSqrIncl1Charge alg must have either 1 inputs, but got " << input.size());
}
return TCS::StatusCode::SUCCESS;
}
TCS::StatusCode
TCS::InvariantMassInclusiveDeltaRSqrIncl1Charge::process( const std::vector<TCS::TOBArray const *> & input,
const std::vector<TCS::TOBArray *> & output,
Decision & decision )
{
if(input.size() == 1) {
for( TOBArray::const_iterator tob1 = input[0]->begin();
tob1 != input[0]->end() && distance( input[0]->begin(), tob1) < p_NumberLeading1;
++tob1)
{
TCS::TOBArray::const_iterator tob2 = tob1; ++tob2;
for( ;
tob2 != input[0]->end() && distance( input[0]->begin(), tob2) < p_NumberLeading2;
++tob2) {
// OneBarrel
if (p_OneBarrel && parType_t(std::abs((*tob1)->eta())) > 10 && parType_t(std::abs((*tob2)->eta())) > 10 ) continue;
// Inv Mass calculation
unsigned int invmass2 = TSU::Kinematics::calcInvMass( *tob1, *tob2 );
// test DeltaR2Min, DeltaR2Max
unsigned int deltaR2 = TSU::Kinematics::calcDeltaR2( *tob1, *tob2 );
TRG_MSG_DEBUG("Jet1 = " << **tob1 << ", Jet2 = " << **tob2 << ", invmass2 = " << invmass2 << ", deltaR2 = " << deltaR2);
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName();
int charge1 = (*tob1)->charge();
int charge2 = (*tob2)->charge();
int totalCharge = charge1 + charge2;
bool acceptCharge = true;
if ( sector1 != "" && sector2 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' ) {
if ( totalCharge == 0 or totalCharge == 2 ) { acceptCharge = false; }
}
for(unsigned int i=0; i<numberOutputBits(); ++i) {
bool accept = false;
if( parType_t((*tob1)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut
if( parType_t((*tob2)->Et()) <= std::min(p_MinET1[i],p_MinET2[i])) continue; // ET cut
if( (parType_t((*tob1)->Et()) <= std::max(p_MinET1[i],p_MinET2[i])) && (parType_t((*tob2)->Et()) <= std::max(p_MinET1[i],p_MinET2[i]))) continue;
accept = invmass2 >= p_InvMassMin[i] && invmass2 <= p_InvMassMax[i] && deltaR2 >= p_DeltaRMin[i] && deltaR2 <= p_DeltaRMax[i] && acceptCharge;
const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(i) : accept);
const bool fillReject = fillHistos() and not fillAccept;
const bool alreadyFilled = decision.bit(i);
if( accept ) {
decision.setBit(i, true);
output[i]->push_back( TCS::CompositeTOB(*tob1, *tob2) );
}
if(fillAccept and not alreadyFilled) {
fillHist2D(m_histAcceptM[i],std::sqrt(static_cast<float>(invmass2)),std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
} else if(fillReject) {
fillHist2D(m_histRejectM[i],std::sqrt(static_cast<float>(invmass2)),std::sqrt(static_cast<float>(deltaR2)));
fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
}
TRG_MSG_DEBUG("Decision " << i << ": " << (accept?"pass":"fail") << " invmass2 = " << invmass2 << " deltaR2 = " << deltaR2 );
}
}
}
} else {
TCS_EXCEPTION("InvariantMassInclusiveDeltaRSqrIncl1Charge alg must have either 1 inputs, but got " << input.size());
}
return TCS::StatusCode::SUCCESS;
}
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* For questions contact atlas-trig-l1topo-algcom@cern.ch. * For questions contact atlas-trig-l1topo-algcom@cern.ch.
* @brief Algorithm calculates the sqr of the INVMASS of three TOBs from one list and applies invmass criteria. * @brief Algorithm calculates the sqr of the INVMASS of three TOBs from one list and applies invmass criteria.
* Following ATR-19638, an additional cut in the muon charge is required. * Events containing 3 TGC muons with same charge are rejected
* *
* @param NumberLeading * @param NumberLeading
* *
...@@ -106,8 +106,8 @@ TCS::InvariantMassThreeTOBsInclCharge::initialize() { ...@@ -106,8 +106,8 @@ TCS::InvariantMassThreeTOBsInclCharge::initialize() {
std::string hname_acceptEta3Eta1 = "hInvariantMassThreeTOBsInclCharge_acceptEta3Eta1_bit"+std::to_string(static_cast<int>(i)); std::string hname_acceptEta3Eta1 = "hInvariantMassThreeTOBsInclCharge_acceptEta3Eta1_bit"+std::to_string(static_cast<int>(i));
std::string hname_rejectEta3Eta1 = "hInvariantMassThreeTOBsInclCharge_rejectEta3Eta1_bit"+std::to_string(static_cast<int>(i)); std::string hname_rejectEta3Eta1 = "hInvariantMassThreeTOBsInclCharge_rejectEta3Eta1_bit"+std::to_string(static_cast<int>(i));
// mass // mass
bookHist(m_histAccept, hname_accept, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); bookHist(m_histAccept, hname_accept, "INVM", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]));
bookHist(m_histReject, hname_reject, "INVM", 100, sqrt(p_InvMassMin[i]), sqrt(p_InvMassMax[i])); bookHist(m_histReject, hname_reject, "INVM", 100, std::sqrt(p_InvMassMin[i]), std::sqrt(p_InvMassMax[i]));
// eta vs eta // eta vs eta
bookHist(m_histAcceptEta1Eta2, hname_acceptEta1Eta2, "ETA vs ETA", 100, -70, 70, 100, -70, 70); bookHist(m_histAcceptEta1Eta2, hname_acceptEta1Eta2, "ETA vs ETA", 100, -70, 70, 100, -70, 70);
bookHist(m_histRejectEta1Eta2, hname_rejectEta1Eta2, "ETA vs ETA", 100, -70, 70, 100, -70, 70); bookHist(m_histRejectEta1Eta2, hname_rejectEta1Eta2, "ETA vs ETA", 100, -70, 70, 100, -70, 70);
...@@ -154,7 +154,9 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS: ...@@ -154,7 +154,9 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS:
unsigned int invmass2_13 = TSU::Kinematics::calcInvMassBW( *tob1, *tob3 ); unsigned int invmass2_13 = TSU::Kinematics::calcInvMassBW( *tob1, *tob3 );
unsigned int invmass2_23 = TSU::Kinematics::calcInvMassBW( *tob2, *tob3 ); unsigned int invmass2_23 = TSU::Kinematics::calcInvMassBW( *tob2, *tob3 );
unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23; unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
// Muon sector and charge // Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName(); std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName(); std::string sector2 = (*tob2)->sectorName();
std::string sector3 = (*tob3)->sectorName(); std::string sector3 = (*tob3)->sectorName();
...@@ -162,8 +164,6 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS: ...@@ -162,8 +164,6 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS:
int charge2 = (*tob2)->charge(); int charge2 = (*tob2)->charge();
int charge3 = (*tob3)->charge(); int charge3 = (*tob3)->charge();
int totalCharge = charge1 + charge2 + charge3; int totalCharge = charge1 + charge2 + charge3;
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Reject if 3 TGC muons with total charge = -3 or 3 ( 0 or 3 in our convention )
bool acceptCharge = true; bool acceptCharge = true;
if ( sector1 != "" && sector2 != "" && sector3 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' && sector3.at(0) != 'B' ) { if ( sector1 != "" && sector2 != "" && sector3 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' && sector3.at(0) != 'B' ) {
if ( totalCharge == 0 or totalCharge == 3 ) { acceptCharge = false; } if ( totalCharge == 0 or totalCharge == 3 ) { acceptCharge = false; }
...@@ -188,12 +188,12 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS: ...@@ -188,12 +188,12 @@ TCS::InvariantMassThreeTOBsInclCharge::processBitCorrect( const std::vector<TCS:
TOBvector.clear(); TOBvector.clear();
} }
if(fillAccept and not alreadyFilled) { if(fillAccept and not alreadyFilled) {
fillHist1D(m_histAccept[i],sqrt(invmass2)); fillHist1D(m_histAccept[i],std::sqrt(invmass2));
fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta()); fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
fillHist2D(m_histAcceptEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta()); fillHist2D(m_histAcceptEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta());
fillHist2D(m_histAcceptEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta()); fillHist2D(m_histAcceptEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta());
} else if(fillReject) { } else if(fillReject) {
fillHist1D(m_histReject[i],sqrt(invmass2)); fillHist1D(m_histReject[i],std::sqrt(invmass2));
fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta()); fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
fillHist2D(m_histRejectEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta()); fillHist2D(m_histRejectEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta());
fillHist2D(m_histRejectEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta()); fillHist2D(m_histRejectEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta());
...@@ -244,7 +244,9 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray ...@@ -244,7 +244,9 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray
unsigned int invmass2_13 = TSU::Kinematics::calcInvMass( *tob1, *tob3 ); unsigned int invmass2_13 = TSU::Kinematics::calcInvMass( *tob1, *tob3 );
unsigned int invmass2_23 = TSU::Kinematics::calcInvMass( *tob2, *tob3 ); unsigned int invmass2_23 = TSU::Kinematics::calcInvMass( *tob2, *tob3 );
unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23; unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
// Muon sector and charge // Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Check the definition of sectorName at MuCTPIL1TopoCandidate.h (for TGC muons: sectorName.at(0)=E or F, for RPC muons: sectorName.at(0)=B)
// If no muon sectorName information is available, sectorName = ""
std::string sector1 = (*tob1)->sectorName(); std::string sector1 = (*tob1)->sectorName();
std::string sector2 = (*tob2)->sectorName(); std::string sector2 = (*tob2)->sectorName();
std::string sector3 = (*tob3)->sectorName(); std::string sector3 = (*tob3)->sectorName();
...@@ -252,8 +254,6 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray ...@@ -252,8 +254,6 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray
int charge2 = (*tob2)->charge(); int charge2 = (*tob2)->charge();
int charge3 = (*tob3)->charge(); int charge3 = (*tob3)->charge();
int totalCharge = charge1 + charge2 + charge3; int totalCharge = charge1 + charge2 + charge3;
// Charge cut ( for TGC muons: 0=negative, 1=positive, as described at ATR-22621 )
// Reject if 3 TGC muons with total charge = -3 or 3 ( 0 or 3 in our convention )
bool acceptCharge = true; bool acceptCharge = true;
if ( sector1 != "" && sector2 != "" && sector3 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' && sector3.at(0) != 'B' ) { if ( sector1 != "" && sector2 != "" && sector3 != "" && sector1.at(0) != 'B' && sector2.at(0) != 'B' && sector3.at(0) != 'B' ) {
if ( totalCharge == 0 or totalCharge == 3 ) { acceptCharge = false; } if ( totalCharge == 0 or totalCharge == 3 ) { acceptCharge = false; }
...@@ -278,12 +278,12 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray ...@@ -278,12 +278,12 @@ TCS::InvariantMassThreeTOBsInclCharge::process( const std::vector<TCS::TOBArray
TOBvector.clear(); TOBvector.clear();
} }
if(fillAccept and not alreadyFilled) { if(fillAccept and not alreadyFilled) {
fillHist1D(m_histAccept[i],sqrt(invmass2)); fillHist1D(m_histAccept[i],std::sqrt(invmass2));
fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta()); fillHist2D(m_histAcceptEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
fillHist2D(m_histAcceptEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta()); fillHist2D(m_histAcceptEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta());
fillHist2D(m_histAcceptEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta()); fillHist2D(m_histAcceptEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta());
} else if(fillReject) { } else if(fillReject) {
fillHist1D(m_histReject[i],sqrt(invmass2)); fillHist1D(m_histReject[i],std::sqrt(invmass2));
fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta()); fillHist2D(m_histRejectEta1Eta2[i],(*tob1)->eta(),(*tob2)->eta());
fillHist2D(m_histRejectEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta()); fillHist2D(m_histRejectEta2Eta3[i],(*tob2)->eta(),(*tob3)->eta());
fillHist2D(m_histRejectEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta()); fillHist2D(m_histRejectEta3Eta1[i],(*tob3)->eta(),(*tob1)->eta());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment