Skip to content

Commit

Permalink
Merge pull request cms-sw#192 from dildick/for-75X-GEM-CSC-Trigger
Browse files Browse the repository at this point in the history
For 75 x gem csc trigger
  • Loading branch information
jshlee committed Apr 10, 2015
2 parents bd62b88 + 5bdc2ec commit 1727a50
Show file tree
Hide file tree
Showing 24 changed files with 5,399 additions and 125 deletions.
32 changes: 32 additions & 0 deletions DataFormats/CSCDigi/interface/GEMCSCLCTDigi.h
@@ -0,0 +1,32 @@
#ifndef CSCDigi_GEMCSCLCTDigi_h
#define CSCDigi_GEMCSCLCTDigi_h

#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h"
#include <boost/cstdint.hpp>
#include <iosfwd>

class GEMCSCLCTDigi
{
public:

/// Constructors
GEMCSCLCTDigi(const CSCCorrelatedLCTDigi, float);
GEMCSCLCTDigi(); /// default

/// return track number
const CSCCorrelatedLCTDigi& getDigi() const { return digi_; }

/// return bend
int getBend() const { return bend_; }

///Comparison
bool operator == (const GEMCSCLCTDigi &) const;
bool operator != (const GEMCSCLCTDigi &rhs) const
{ return !(this->operator==(rhs)); }

private:
CSCCorrelatedLCTDigi digi_;
float bend_;
};

#endif
10 changes: 10 additions & 0 deletions DataFormats/CSCDigi/interface/GEMCSCLCTDigiCollection.h
@@ -0,0 +1,10 @@
#ifndef GEMCSCLCTDigi_GEMCSCLCTDigiCollection_h
#define GEMCSCLCTDigi_GEMCSCLCTDigiCollection_h

#include <DataFormats/MuonDetId/interface/CSCDetId.h>
#include <DataFormats/CSCDigi/interface/GEMCSCLCTDigi.h>
#include <DataFormats/MuonData/interface/MuonDigiCollection.h>

typedef MuonDigiCollection<CSCDetId,GEMCSCLCTDigi> GEMCSCLCTDigiCollection;

#endif
18 changes: 18 additions & 0 deletions DataFormats/CSCDigi/src/GEMCSCLCTDigi.cc
@@ -0,0 +1,18 @@
#include "DataFormats/CSCDigi/interface/GEMCSCLCTDigi.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include <iostream>

/// Constructors
GEMCSCLCTDigi::GEMCSCLCTDigi(const CSCCorrelatedLCTDigi digi, float bend) :
digi_(digi),
bend_(bend)
{}

/// Default
GEMCSCLCTDigi::GEMCSCLCTDigi() {
}

/// Comparison
bool GEMCSCLCTDigi::operator==(const GEMCSCLCTDigi &rhs) const {
return ( digi_ == rhs.getDigi() && bend_ == rhs.getBend() );
}
7 changes: 7 additions & 0 deletions DataFormats/CSCDigi/src/classes.h
Expand Up @@ -12,6 +12,8 @@
#include <DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h>
#include <DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h>
#include <DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h>
#include <DataFormats/CSCDigi/interface/GEMCSCLCTDigi.h>
#include <DataFormats/CSCDigi/interface/GEMCSCLCTDigiCollection.h>
#include <DataFormats/CSCDigi/interface/CSCCFEBStatusDigi.h>
#include <DataFormats/CSCDigi/interface/CSCCFEBStatusDigiCollection.h>
#include <DataFormats/CSCDigi/interface/CSCDMBStatusDigi.h>
Expand Down Expand Up @@ -44,6 +46,7 @@ namespace DataFormats_CSCDigi {
CSCCLCTDigi cCLCTD_;
CSCALCTDigi cALCTD_;
CSCCorrelatedLCTDigi cCorLCTD_;
GEMCSCLCTDigi gcLCTD_;
CSCCFEBStatusDigi cCSD_;
CSCTMBStatusDigi cTMBSD_;
CSCDCCFormatStatusDigi cDFSD_;
Expand All @@ -61,6 +64,7 @@ namespace DataFormats_CSCDigi {
std::vector<CSCCLCTDigi> vCLCTD_;
std::vector<CSCALCTDigi> vALCTD_;
std::vector<CSCCorrelatedLCTDigi> vCorLCTD_;
std::vector<GEMCSCLCTDigi> vgcLCTD_;
std::vector<CSCCFEBStatusDigi> vCSD_;
std::vector<CSCTMBStatusDigi> vTMBSD_;
std::vector<CSCDCCFormatStatusDigi> vDFSD_;
Expand All @@ -77,6 +81,7 @@ namespace DataFormats_CSCDigi {
std::vector<std::vector<CSCCLCTDigi> > vvCLCTD_;
std::vector<std::vector<CSCALCTDigi> > vvALCTD_;
std::vector<std::vector<CSCCorrelatedLCTDigi> > vvCorLCTD_;
std::vector<std::vector<GEMCSCLCTDigi> > vvgcLCTD_;
std::vector<std::vector<CSCCFEBStatusDigi> > vvCSD_;
std::vector<std::vector<CSCTMBStatusDigi> > vvTMBSD_;
std::vector<std::vector<CSCDMBStatusDigi> > vvDMBSD_;
Expand All @@ -93,6 +98,7 @@ namespace DataFormats_CSCDigi {
CSCCLCTDigiCollection clCLCTD_;
CSCALCTDigiCollection clALCTD_;
CSCCorrelatedLCTDigiCollection clCorLCTD_;
GEMCSCLCTDigiCollection clgcLCTD_;
CSCCFEBStatusDigiCollection clCSD_;
CSCTMBStatusDigiCollection clTMBSD_;
CSCDCCFormatStatusDigiCollection clDFSD_;
Expand All @@ -109,6 +115,7 @@ namespace DataFormats_CSCDigi {
edm::Wrapper<CSCCLCTDigiCollection> wCLCTD_;
edm::Wrapper<CSCALCTDigiCollection> wALCTD_;
edm::Wrapper<CSCCorrelatedLCTDigiCollection> wCorLCTD_;
edm::Wrapper<GEMCSCLCTDigiCollection> wgcLCTD_;
edm::Wrapper<CSCCFEBStatusDigiCollection> wCSD_;
edm::Wrapper<CSCTMBStatusDigiCollection> wTMBSD_;
edm::Wrapper<CSCDCCFormatStatusDigiCollection> wDFSD_;
Expand Down
8 changes: 8 additions & 0 deletions DataFormats/CSCDigi/src/classes_def.xml
Expand Up @@ -14,6 +14,9 @@
<class name="CSCCorrelatedLCTDigi" ClassVersion="10">
<version ClassVersion="10" checksum="1301481852"/>
</class>
<class name="GEMCSCLCTDigi" ClassVersion="10">
<version ClassVersion="10" checksum="967689346"/>
</class>
<class name="CSCCLCTDigi" ClassVersion="10">
<version ClassVersion="10" checksum="3910057547"/>
</class>
Expand Down Expand Up @@ -47,6 +50,7 @@
<class name="std::vector<CSCStripDigi>"/>
<class name="std::vector<CSCComparatorDigi>"/>
<class name="std::vector<CSCCorrelatedLCTDigi>"/>
<class name="std::vector<GEMCSCLCTDigi>"/>
<class name="std::vector<CSCCLCTDigi>"/>
<class name="std::vector<CSCALCTDigi>"/>
<class name="std::vector<CSCCFEBStatusDigi>"/>
Expand All @@ -62,6 +66,7 @@
<class name="std::map<CSCDetId,std::vector<CSCStripDigi> >"/>
<class name="std::map<CSCDetId,std::vector<CSCComparatorDigi> >"/>
<class name="std::map<CSCDetId,std::vector<CSCCorrelatedLCTDigi> >"/>
<class name="std::map<CSCDetId,std::vector<GEMCSCLCTDigi> >"/>
<class name="std::map<CSCDetId,std::vector<CSCCLCTDigi> >"/>
<class name="std::map<CSCDetId,std::vector<CSCALCTDigi> >"/>
<class name="std::map<CSCDetId,std::vector<CSCCFEBStatusDigi> >"/>
Expand All @@ -78,6 +83,7 @@
<class name="std::pair<CSCDetId,std::vector<CSCStripDigi> >"/>
<class name="std::pair<CSCDetId,std::vector<CSCComparatorDigi> >"/>
<class name="std::pair<CSCDetId,std::vector<CSCCorrelatedLCTDigi> >"/>
<class name="std::pair<CSCDetId,std::vector<GEMCSCLCTDigi> >"/>
<class name="std::pair<CSCDetId,std::vector<CSCCLCTDigi> >"/>
<class name="std::pair<CSCDetId,std::vector<CSCALCTDigi> >"/>
<class name="std::pair<CSCDetId,std::vector<CSCCFEBStatusDigi> >"/>
Expand All @@ -95,6 +101,7 @@
<class name="MuonDigiCollection<CSCDetId,CSCStripDigi>"/>
<class name="MuonDigiCollection<CSCDetId,CSCComparatorDigi>"/>
<class name="MuonDigiCollection<CSCDetId,CSCCorrelatedLCTDigi>"/>
<class name="MuonDigiCollection<CSCDetId,GEMCSCLCTDigi>"/>
<class name="MuonDigiCollection<CSCDetId,CSCCLCTDigi>"/>
<class name="MuonDigiCollection<CSCDetId,CSCALCTDigi>"/>
<class name="MuonDigiCollection<CSCDetId,CSCCFEBStatusDigi>"/>
Expand All @@ -111,6 +118,7 @@
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,CSCStripDigi>>" splitLevel="0"/>
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,CSCComparatorDigi>>" splitLevel="0"/>
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,CSCCorrelatedLCTDigi> >" splitLevel="0"/>
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,GEMCSCLCTDigi> >" splitLevel="0"/>
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,CSCCLCTDigi> >" splitLevel="0"/>
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,CSCALCTDigi> >" splitLevel="0"/>
<class name="edm::Wrapper<MuonDigiCollection<CSCDetId,CSCCFEBStatusDigi> >" splitLevel="0"/>
Expand Down
2 changes: 2 additions & 0 deletions L1Trigger/CSCTriggerPrimitives/BuildFile.xml
@@ -1,10 +1,12 @@
<use name="CondFormats/CSCObjects"/>
<use name="DataFormats/CSCDigi"/>
<use name="DataFormats/GEMDigi"/>
<use name="DataFormats/L1CSCTrackFinder"/>
<use name="DataFormats/MuonDetId"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="Geometry/GEMGeometry"/>
<use name="L1Trigger/CSCCommonTrigger"/>
<export>
<lib name="1"/>
Expand Down
Expand Up @@ -22,13 +22,18 @@
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h"
#include "CondFormats/DataRecord/interface/CSCBadChambersRcd.h"
#include "Geometry/GEMGeometry/interface/GEMGeometry.h"

//#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
//#include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCALCTDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCCLCTDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigiCollection.h"

#include "DataFormats/CSCDigi/interface/GEMCSCLCTDigiCollection.h"
#include "DataFormats/GEMDigi/interface/GEMPadDigiCollection.h"
#include "DataFormats/GEMDigi/interface/GEMCoPadDigiCollection.h"

// Configuration via EventSetup
#include "CondFormats/CSCObjects/interface/CSCDBL1TPParameters.h"
#include "CondFormats/DataRecord/interface/CSCDBL1TPParametersRcd.h"
Expand All @@ -38,26 +43,31 @@ CSCTriggerPrimitivesProducer::CSCTriggerPrimitivesProducer(const edm::ParameterS

// if false, parameters will be read in from DB using EventSetup mechanism
// else will use all parameters from the config file
debugParameters_ = conf.getUntrackedParameter<bool>("debugParameters",false);
debugParameters_ = conf.getParameter<bool>("debugParameters");

wireDigiProducer_ = conf.getParameter<edm::InputTag>("CSCWireDigiProducer");
compDigiProducer_ = conf.getParameter<edm::InputTag>("CSCComparatorDigiProducer");
checkBadChambers_ = conf.getUntrackedParameter<bool>("checkBadChambers", true);
gemPadDigiProducer_ = conf.existsAs<edm::InputTag>("GEMPadDigiProducer")?conf.getParameter<edm::InputTag>("GEMPadDigiProducer"):edm::InputTag("");
checkBadChambers_ = conf.getParameter<bool>("checkBadChambers");

lctBuilder_ = new CSCTriggerPrimitivesBuilder(conf); // pass on the conf

wire_token_ = consumes<CSCWireDigiCollection>(wireDigiProducer_);
comp_token_ = consumes<CSCComparatorDigiCollection>(compDigiProducer_);
gem_pad_token_ = consumes<GEMPadDigiCollection>(gemPadDigiProducer_);

// register what this produces
produces<CSCALCTDigiCollection>();
produces<CSCCLCTDigiCollection>();
produces<CSCCLCTPreTriggerCollection>();
produces<CSCCorrelatedLCTDigiCollection>();
produces<CSCCorrelatedLCTDigiCollection>("MPCSORTED");
produces<GEMCoPadDigiCollection>();
produces<GEMCSCLCTDigiCollection>();
usesResource("CSCTriggerGeometry");
consumes<CSCComparatorDigiCollection>(compDigiProducer_);
consumes<CSCWireDigiCollection>(wireDigiProducer_);
consumes<GEMPadDigiCollection>(gemPadDigiProducer_);
}

CSCTriggerPrimitivesProducer::~CSCTriggerPrimitivesProducer() {
Expand All @@ -80,6 +90,15 @@ void CSCTriggerPrimitivesProducer::produce(edm::Event& ev,
edm::ESHandle<CSCGeometry> h;
setup.get<MuonGeometryRecord>().get(h);
CSCTriggerGeometry::setGeometry(h);

edm::ESHandle<GEMGeometry> h_gem;
try {
setup.get<MuonGeometryRecord>().get(h_gem);
// lctBuilder_->setGEMGeometry(&*h_gem);
} catch (edm::eventsetup::NoProxyException<GEMGeometry>& e) {
edm::LogInfo("L1CSCTPEmulatorNoGEMGeometry")
<< "+++ Info: GEM geometry is unavailable. Running CSC-only trigger algorithm. +++\n";
}
}

// Find conditions data for bad chambers.
Expand Down Expand Up @@ -109,13 +128,24 @@ void CSCTriggerPrimitivesProducer::produce(edm::Event& ev,
ev.getByToken(comp_token_, compDigis);
ev.getByToken(wire_token_, wireDigis);

// Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream

const GEMPadDigiCollection *gemPads = nullptr;
if (!gemPadDigiProducer_.label().empty()) {
edm::Handle<GEMPadDigiCollection> gemPadDigis;
ev.getByToken(gem_pad_token_, gemPadDigis);
gemPads = gemPadDigis.product();
}


// Create empty collections of ALCTs, CLCTs, and correlated LCTs upstream
// and downstream of MPC.
std::auto_ptr<CSCALCTDigiCollection> oc_alct(new CSCALCTDigiCollection);
std::auto_ptr<CSCCLCTDigiCollection> oc_clct(new CSCCLCTDigiCollection);
std::auto_ptr<CSCCLCTPreTriggerCollection> oc_pretrig(new CSCCLCTPreTriggerCollection);
std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_lct(new CSCCorrelatedLCTDigiCollection);
std::auto_ptr<CSCCorrelatedLCTDigiCollection> oc_sorted_lct(new CSCCorrelatedLCTDigiCollection);
std::auto_ptr<GEMCoPadDigiCollection> oc_gemcopad(new GEMCoPadDigiCollection);
std::auto_ptr<GEMCSCLCTDigiCollection> oc_gemcsclct(new GEMCSCLCTDigiCollection);

if (!wireDigis.isValid()) {
edm::LogWarning("L1CSCTPEmulatorNoInputCollection")
Expand All @@ -135,8 +165,8 @@ void CSCTriggerPrimitivesProducer::produce(edm::Event& ev,
if (wireDigis.isValid() && compDigis.isValid()) {
const CSCBadChambers* temp = checkBadChambers_ ? pBadChambers.product() : new CSCBadChambers;
lctBuilder_->build(temp,
wireDigis.product(), compDigis.product(),
*oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct);
wireDigis.product(), compDigis.product(), gemPads,
*oc_alct, *oc_clct, *oc_pretrig, *oc_lct, *oc_sorted_lct, *oc_gemcopad, *oc_gemcsclct);
if (!checkBadChambers_)
delete temp;
}
Expand All @@ -147,4 +177,6 @@ void CSCTriggerPrimitivesProducer::produce(edm::Event& ev,
ev.put(oc_pretrig);
ev.put(oc_lct);
ev.put(oc_sorted_lct,"MPCSORTED");
ev.put(oc_gemcopad);
ev.put(oc_gemcsclct);
}
Expand Up @@ -22,6 +22,8 @@

#include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
#include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
#include "DataFormats/GEMDigi/interface/GEMPadDigiCollection.h"

#include <FWCore/Framework/interface/ConsumesCollector.h>
#include <FWCore/Framework/interface/Frameworkfwd.h>
#include <FWCore/Framework/interface/one/EDProducer.h>
Expand All @@ -45,8 +47,10 @@ class CSCTriggerPrimitivesProducer : public edm::one::EDProducer<edm::one::Share

edm::InputTag compDigiProducer_;
edm::InputTag wireDigiProducer_;
edm::InputTag gemPadDigiProducer_;
edm::EDGetTokenT<CSCComparatorDigiCollection> comp_token_;
edm::EDGetTokenT<CSCWireDigiCollection> wire_token_;
edm::EDGetTokenT<GEMPadDigiCollection> gem_pad_token_;

// switch to force the use of parameters from config file rather then from DB
bool debugParameters_;
Expand Down

0 comments on commit 1727a50

Please sign in to comment.