Skip to content

Commit

Permalink
Minor changes to include the three-body invariant mass feature in CMS…
Browse files Browse the repository at this point in the history
…SW_12_0_X
  • Loading branch information
elfontan committed May 31, 2021
1 parent ea3107c commit 704b9a1
Show file tree
Hide file tree
Showing 12 changed files with 629 additions and 203,794 deletions.
203,190 changes: 0 additions & 203,190 deletions L1Trigger/L1TGlobal/data/Luminosity/startup/L1Menu_test_mass_3_body_reduced_v2.xml

This file was deleted.

13 changes: 6 additions & 7 deletions L1Trigger/L1TGlobal/interface/CorrThreeBodyCondition.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* \author: Elisa Fontanesi - Boston University
* CorrCondition and CorrWithOverlapRemovalCondition classes used as a starting point
*
*/
*/

// system include files
#include <iosfwd>
Expand Down Expand Up @@ -43,10 +43,10 @@ namespace l1t {

/// from base template condition (from event setup usually)
CorrThreeBodyCondition(const GlobalCondition*,
const GlobalCondition*,
const GlobalCondition*,
const GlobalCondition*,
const GlobalBoard*
const GlobalCondition*,
const GlobalCondition*,
const GlobalCondition*,
const GlobalBoard*

);

Expand Down Expand Up @@ -98,13 +98,12 @@ namespace l1t {
// pointer to subconditions
const GlobalCondition* m_gtCond0;
const GlobalCondition* m_gtCond1;
const GlobalCondition* m_gtCond2;
const GlobalCondition* m_gtCond2;

/// pointer to uGt GlobalBoard, to be able to get the trigger objects
const GlobalBoard* m_uGtB;

const GlobalScales* m_gtScales;

};

} // namespace l1t
Expand Down
21 changes: 10 additions & 11 deletions L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

// forward declarations


// class declaration
class CorrelationThreeBodyTemplate : public GlobalCondition {
public:
Expand All @@ -42,17 +41,15 @@ class CorrelationThreeBodyTemplate : public GlobalCondition {
/// from condition name
CorrelationThreeBodyTemplate(const std::string&);


/// from condition name, the category of first, second, and third subcondition,
/// from condition name, the category of first, second, and third subcondition,
/// the index of first, second, third subcondition in the cor* vector
CorrelationThreeBodyTemplate(const std::string&,
const l1t::GtConditionCategory&,
const l1t::GtConditionCategory&,
const l1t::GtConditionCategory&,
const int,
const int,
const int);

const l1t::GtConditionCategory&,
const l1t::GtConditionCategory&,
const l1t::GtConditionCategory&,
const int,
const int,
const int);

/// copy constructor
CorrelationThreeBodyTemplate(const CorrelationThreeBodyTemplate&);
Expand Down Expand Up @@ -102,7 +99,9 @@ class CorrelationThreeBodyTemplate : public GlobalCondition {
void setCond2Index(const int&);

/// get / set correlation parameters
inline const CorrelationThreeBodyParameter* correlationThreeBodyParameter() const { return &m_correlationThreeBodyParameter; }
inline const CorrelationThreeBodyParameter* correlationThreeBodyParameter() const {
return &m_correlationThreeBodyParameter;
}
void setCorrelationThreeBodyParameter(const CorrelationThreeBodyParameter& corrThreeBodyParameter);

/// print the condition
Expand Down
6 changes: 4 additions & 2 deletions L1Trigger/L1TGlobal/interface/TriggerMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ class TriggerMenu {
void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);

//
inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTemplate() const {
inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
vecCorrelationWithOverlapRemovalTemplate() const {
return m_vecCorrelationWithOverlapRemovalTemplate;
}

void setVecCorrelationWithOverlapRemovalTemplate(const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
void setVecCorrelationWithOverlapRemovalTemplate(
const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);

//
inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
Expand Down
47 changes: 23 additions & 24 deletions L1Trigger/L1TGlobal/plugins/TriggerMenuParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ void l1t::TriggerMenuParser::setVecCorrelationTemplate(
m_vecCorrelationTemplate = vecCorrelationTempl;
}

//void l1t::TriggerMenuParser::setVecCorrelationThreeBodyTemplate(
// const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
// m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
//}
void l1t::TriggerMenuParser::setVecCorrelationThreeBodyTemplate(
const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTempl) {
m_vecCorrelationThreeBodyTemplate = vecCorrelationThreeBodyTempl;
}

void l1t::TriggerMenuParser::setVecCorrelationWithOverlapRemovalTemplate(
const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTempl) {
Expand Down Expand Up @@ -311,7 +311,7 @@ void l1t::TriggerMenuParser::parseCondFormats(const L1TUtmTriggerMenu* utmMenu)
condition.getType() == esConditionType::InvariantMassUpt) { // Added for displaced muons
parseCorrelation(condition, chipNr);

//parse three-body Correlation Conditions
//parse three-body Correlation Conditions
} else if (condition.getType() == esConditionType::InvariantMass3) {
parseCorrelationThreeBody(condition, chipNr);

Expand Down Expand Up @@ -2844,7 +2844,7 @@ bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition
std::string type = l1t2string(corrCond.getType());
std::string name = l1t2string(corrCond.getName());

LogDebug("TriggerMenuParser") << " ****************************************** " << std::endl
LogDebug("TriggerMenuParser") << " ****************************************** " << std::endl
<< " (in parseCorrelationThreeBody) " << std::endl
<< " condition = " << condition << std::endl
<< " particle = " << particle << std::endl
Expand All @@ -2867,8 +2867,8 @@ bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition
const int nrObj = 3;

// object types and greater equal flag - filled in the loop
std::vector<GlobalObject> objType(nrObj);
std::vector<GtConditionCategory> condCateg(nrObj);
std::vector<GlobalObject> objType(nrObj);
std::vector<GtConditionCategory> condCateg(nrObj);

// correlation flag and index in the cor*vector
const bool corrFlag = true;
Expand All @@ -2888,29 +2888,28 @@ bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition
//
double minV = cut.getMinimum().value;
double maxV = cut.getMaximum().value;

//Scale down very large numbers out of xml
if (maxV > 1.0e8) maxV = 1.0e8;

if (maxV > 1.0e8)
maxV = 1.0e8;

if (cut.getCutType() == esCutType::Mass) {
LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType()
<< "\tMass Cut minV = " << minV
<< "\tMass Cut maxV = " << maxV
<< " precMin = " << cut.getMinimum().index
<< " precMax = " << cut.getMaximum().index << std::endl;
LogDebug("TriggerMenuParser") << "CutType: " << cut.getCutType() << "\tMass Cut minV = " << minV
<< "\tMass Cut maxV = " << maxV << " precMin = " << cut.getMinimum().index
<< " precMax = " << cut.getMaximum().index << std::endl;
corrThreeBodyParameter.minMassCutValue = (long long)(minV * pow(10., cut.getMinimum().index));
corrThreeBodyParameter.maxMassCutValue = (long long)(maxV * pow(10., cut.getMaximum().index));
corrThreeBodyParameter.precMassCut = cut.getMinimum().index;
cutType = cutType | 0x8;
}
}
corrThreeBodyParameter.corrCutType = cutType;

// Get the three objects that form the legs
const std::vector<esObject>& objects = corrCond.getObjects();
if (objects.size() != 3) {
edm::LogError("TriggerMenuParser") << "incorrect number of objects for the correlation condition " << name
<< " corrFlag " << corrFlag << std::endl;
edm::LogError("TriggerMenuParser") << "incorrect number of objects for the correlation condition " << name
<< " corrFlag " << corrFlag << std::endl;
return false;
}

Expand All @@ -2924,7 +2923,7 @@ bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition
// check the leg type
if (object.getType() == esObjectType::Muon) {
// we have a muon
parseMuonCorr(&object, chipNr);
parseMuonCorr(&object, chipNr);
corrIndexVal[lll] = (m_corMuonTemplate[chipNr]).size() - 1;

//Now set some flags for this subCondition
Expand All @@ -2933,9 +2932,9 @@ bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition

} else {
edm::LogError("TriggerMenuParser") << "Checked the object Type " << object.getType()
<< " for the correlation condition " << name
<< ": no three muons in the event!" << std::endl;
}
<< " for the correlation condition " << name
<< ": no three muons in the event!" << std::endl;
}
} // End loop over legs

// fill the three-body correlation condition
Expand Down Expand Up @@ -2963,7 +2962,7 @@ bool l1t::TriggerMenuParser::parseCorrelationThreeBody(tmeventsetup::esCondition
// condition is not duplicate, check was done at the beginning

(m_vecCorrelationThreeBodyTemplate[chipNr]).push_back(correlationThreeBodyCond);

//
return true;
}
Expand Down
5 changes: 3 additions & 2 deletions L1Trigger/L1TGlobal/plugins/TriggerMenuParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ namespace l1t {
return m_vecCorrelationWithOverlapRemovalTemplate;
}

void setVecCorrelationWithOverlapRemovalTemplate(const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
void setVecCorrelationWithOverlapRemovalTemplate(
const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);

// get / set the vectors containing the conditions for correlation templates
//
Expand Down Expand Up @@ -287,7 +288,7 @@ namespace l1t {
/// parse a correlation condition
bool parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);

/// parse a three-body correlation condition
/// parse a three-body correlation condition
bool parseCorrelationThreeBody(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);

/// parse a correlation condition with overlap removal
Expand Down
Loading

0 comments on commit 704b9a1

Please sign in to comment.