Skip to content

Commit

Permalink
add HW validation algorithm, tie it to firmware version #3
Browse files Browse the repository at this point in the history
  • Loading branch information
R. Alex Barbieri committed Jun 13, 2014
1 parent 6739b04 commit 3b1dac2
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 4 deletions.
2 changes: 2 additions & 0 deletions L1Trigger/L1TCalorimeter/interface/JetFinderMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace l1t {
int deltaGctPhi(const CaloRegion & region, const CaloRegion & neighbor);
void slidingWindowJetFinder(const int, const std::vector<l1t::CaloRegion> * regions,
std::vector<l1t::Jet> * uncalibjets);
void passThroughJets(const std::vector<l1t::CaloRegion> * regions,
std::vector<l1t::Jet> * uncalibjets);
}

#endif
3 changes: 3 additions & 0 deletions L1Trigger/L1TCalorimeter/interface/PUSubtractionMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ namespace l1t {
void HICaloRingSubtraction(const std::vector<l1t::CaloRegion> & regions,
std::vector<l1t::CaloRegion> *subRegions);

void simpleHWSubtraction(const std::vector<l1t::CaloRegion> & regions,
std::vector<l1t::CaloRegion> *subRegions);

void RegionCorrection(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
std::vector<l1t::CaloRegion> *subRegions,
Expand Down
12 changes: 12 additions & 0 deletions L1Trigger/L1TCalorimeter/interface/Stage1Layer2JetAlgorithmImp.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ namespace l1t {
CaloParamsStage1* const params_;
//double regionLSB_;
};

class Stage1Layer2JetAlgorithmImpSimpleHW : public Stage1Layer2JetAlgorithm {
public:
Stage1Layer2JetAlgorithmImpSimpleHW(CaloParamsStage1* params);
virtual ~Stage1Layer2JetAlgorithmImpSimpleHW();
virtual void processEvent(const std::vector<l1t::CaloRegion> & regions,
const std::vector<l1t::CaloEmCand> & EMCands,
std::vector<l1t::Jet> * jets);
private:
CaloParamsStage1* const params_;
//double regionLSB_;
};
}

#endif
18 changes: 18 additions & 0 deletions L1Trigger/L1TCalorimeter/src/JetFinderMethods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ namespace l1t {
return diff;
}

// turn each central region into a jet
void passThroughJets(const std::vector<l1t::CaloRegion> * regions,
std::vector<l1t::Jet> * uncalibjets)
{
for(std::vector<CaloRegion>::const_iterator region = regions->begin(); region != regions->end(); region++) {
if( region->hwEta() < 4 || region->hwEta() > 17) continue;

int jetET = region->hwPt();
int jetEta = region->hwEta();
int jetPhi = region->hwPhi();
int jetQual = 0;

ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
l1t::Jet theJet(*&jetLorentz, jetET, jetEta, jetPhi, jetQual);
uncalibjets->push_back(theJet);
}
}

void slidingWindowJetFinder(const int jetSeedThreshold, const std::vector<l1t::CaloRegion> * regions,
std::vector<l1t::Jet> * uncalibjets)
{
Expand Down
16 changes: 16 additions & 0 deletions L1Trigger/L1TCalorimeter/src/PUSubtractionMethods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ namespace l1t {
}
}

void simpleHWSubtraction(const std::vector<l1t::CaloRegion> & regions,
std::vector<l1t::CaloRegion> *subRegions)
{
for(std::vector<CaloRegion>::const_iterator region = regions.begin();
region != regions.end(); region++){
int subPt = region->hwPt();
int subEta = region->hwEta();
int subPhi = region->hwPhi();

ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);

CaloRegion newSubRegion(*&ldummy, 0, 0, subPt, subEta, subPhi, 0, 0, 0);
subRegions->push_back(newSubRegion);
}
}


/// --------- New region correction (PUsub, no response correction at the moment) -----------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,24 @@ void Stage1Layer2MainProcessorFirmwareImp1::processEvent(const std::vector<CaloE
m_jetAlgo = new Stage1Layer2JetAlgorithmImpPP(m_db); //fwv =2 => PP algo
m_tauAlgo = new Stage1Layer2TauAlgorithmImpPP(m_db);
}
else if ( m_fwv == 3 )
{ // hw testing algorithms
m_jetAlgo = new Stage1Layer2JetAlgorithmImpSimpleHW(m_db);
}
else{ // undefined fwv version
edm::LogError("FWVersionError")
<< "Undefined firmware version passed to Stage1Layer2MainProcessorFirmwareImp1" << std::endl;
return;
}

m_jetAlgo->processEvent(regions, emcands, jets); // need to run jets before egammas and taus for rel. isol. cuts
m_egAlgo->processEvent(emcands, regions, jets, egammas);
m_tauAlgo->processEvent(emcands, regions, jets, taus);
m_sumAlgo->processEvent(regions, emcands, etsums);
if(m_jetAlgo)
m_jetAlgo->processEvent(regions, emcands, jets); // need to run jets before egammas and taus for rel. isol. cuts
if(m_egAlgo)
m_egAlgo->processEvent(emcands, regions, jets, egammas);
if(m_tauAlgo)
m_tauAlgo->processEvent(emcands, regions, jets, taus);
if(m_sumAlgo)
m_sumAlgo->processEvent(regions, emcands, etsums);

delete m_jetAlgo;
delete m_egAlgo;
Expand Down

0 comments on commit 3b1dac2

Please sign in to comment.