Skip to content

Commit

Permalink
Merge pull request #2 from slava77/CMSSW_6_2_0_SLHC12/tti62XtkMuSW/fr…
Browse files Browse the repository at this point in the history
…om-EP-Muons-80e3a78

L1MuonParticleExtended with its producer and L1TkMus made with it
  • Loading branch information
EmanuelPerez committed May 30, 2014
2 parents 80e3a78 + 1a15ca1 commit f3d240d
Show file tree
Hide file tree
Showing 13 changed files with 879 additions and 25 deletions.
27 changes: 22 additions & 5 deletions DataFormats/L1TrackTrigger/interface/L1TkMuonParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleExtended.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleExtendedFwd.h"

namespace l1extra
{
Expand All @@ -32,7 +34,7 @@ namespace l1extra
typedef TTTrack< Ref_PixelDigi_ > L1TkTrackType;
typedef std::vector< L1TkTrackType > L1TkTrackCollectionType;

L1TkMuonParticle();
L1TkMuonParticle() : theIsolation(-999.), TrkzVtx_(999.), quality_(999) {}
L1TkMuonParticle( const LorentzVector& p4,
const edm::Ptr< DTMatch >& muRef,
float tkisol = -999. );
Expand All @@ -42,6 +44,9 @@ namespace l1extra
const edm::Ptr< L1TkTrackType >& trkPtr,
float tkisol = -999. );

//! more basic constructor, in case refs/ptrs can't be set or to be set separately
L1TkMuonParticle(const reco::LeafCandidate& cand) : reco::LeafCandidate(cand), theIsolation(-999.), TrkzVtx_(999.), quality_(999) {}

virtual ~L1TkMuonParticle() {}

// const member functions
Expand All @@ -50,16 +55,27 @@ namespace l1extra
const edm::Ptr< L1TkTrackType >& getTrkPtr() const
{ return trkPtr_ ; }

const L1MuonParticleRef& getMuRef() const
{ return muRef_ ; }

const L1MuonParticleExtendedRef& getMuExtendedRef() const
{ return muExtendedRef_ ; }

float getTrkIsol() const { return theIsolation; }
float getTrkzVtx() const { return TrkzVtx_ ; }

int bx() const ;

void setTrkzVtx(float TrkzVtx) { TrkzVtx_ = TrkzVtx ; }
void setTrkIsol(float TrkIsol) { theIsolation = TrkIsol ; }
unsigned int quality() const {return quality_;}

unsigned int quality() const;
void setTrkPtr(const edm::Ptr< L1TkTrackType >& p) {trkPtr_ = p;}
void setMuRef(const L1MuonParticleRef& r){muRef_ = r;}
void setMuExtendedRef(const L1MuonParticleExtendedRef& r){muExtendedRef_ = r;}

void setTrkzVtx(float TrkzVtx) { TrkzVtx_ = TrkzVtx ; }
void setTrkIsol(float TrkIsol) { theIsolation = TrkIsol ; }

void setQuality(unsigned int q){ quality_ = q;}

private:

Expand All @@ -69,11 +85,12 @@ namespace l1extra

// used for the Naive producer
edm::Ref< L1MuonParticleCollection > muRef_ ;
L1MuonParticleExtendedRef muExtendedRef_ ;
edm::Ptr< L1TkTrackType > trkPtr_ ;

float theIsolation;
float TrkzVtx_ ;

unsigned int quality_;
};
}

Expand Down
35 changes: 16 additions & 19 deletions DataFormats/L1TrackTrigger/src/L1TkMuonParticle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

using namespace l1extra;

L1TkMuonParticle::L1TkMuonParticle() {}

// Padova's TkMuons
L1TkMuonParticle::L1TkMuonParticle( const LorentzVector& p4,
const edm::Ptr< DTMatch > &muRef,
float tkisol )
: LeafCandidate( ( char ) 0, p4 ),
theDTMatch ( muRef ) ,
theIsolation ( tkisol )
theIsolation ( tkisol ),
TrkzVtx_(999.),
quality_(999)
{
// need to set the z of the track

Expand All @@ -30,14 +30,18 @@ L1TkMuonParticle::L1TkMuonParticle( const LorentzVector& p4,
: LeafCandidate( ( char ) 0, p4 ),
muRef_ ( muRef ) ,
trkPtr_ ( trkPtr ) ,
theIsolation ( tkisol )

theIsolation ( tkisol ),
TrkzVtx_(999),
quality_(999)
{

if ( trkPtr_.isNonnull() ) {
float z = getTrkPtr() -> getPOCA().z();
setTrkzVtx( z );
}
if (muRef_.isNonnull()) {
quality_ = muRef_->gmtMuonCand().quality();
}
}


Expand All @@ -48,26 +52,19 @@ int L1TkMuonParticle::bx() const {
return theDTMatch->getDTBX();
}

if (muRef_.isNonnull() ) {
return dummy;
// PL. In case Pierluigi's objects have a bx
if ( muRef_.isNonnull() ) {
return (getMuRef() -> bx()) ;
}
else if (muExtendedRef_.isNonnull()) {
return getMuExtendedRef()->bx();

}

return dummy;
}


unsigned int L1TkMuonParticle::quality() const {

int dummy = 999;

if ( muRef_.isNonnull() ) {
return (muRef_ -> gmtMuonCand().quality() );
}
else {
return dummy;
}
}




Expand Down
3 changes: 2 additions & 1 deletion DataFormats/L1TrackTrigger/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
<class name="edm::Wrapper<l1extra::L1TkHTMissParticle>"/>
<class name="edm::Wrapper<std::vector<l1extra::L1TkHTMissParticle> >"/>

<class name="l1extra::L1TkMuonParticle" ClassVersion="12">
<class name="l1extra::L1TkMuonParticle" ClassVersion="13">
<version ClassVersion="13" checksum="3928490091"/>
<version ClassVersion="12" checksum="2650978663"/>
</class>
<class name="std::vector<l1extra::L1TkMuonParticle>"/>
Expand Down
107 changes: 107 additions & 0 deletions DataFormats/L1Trigger/interface/L1MuonParticleExtended.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#ifndef L1Trigger_L1MuonParticleExtended_h
#define L1Trigger_L1MuonParticleExtended_h
// -*- C++ -*-
//
// Package: L1Trigger
// Class : L1MuonParticleExtended
//
// Description: L1MuonParticle with detector layer information.
// Should be useful from the start for detailed analysis of efficiency etc
// Expect this to become feasible for future upgrade hardware.

// user include files
#include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
#include "DataFormats/Candidate/interface/LeafCandidate.h"

#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuRegionalCand.h"
#include "DataFormats/DetId/interface/DetId.h"

// forward declarations

namespace l1extra {

class L1MuonParticleExtended : public L1MuonParticle {
public:
L1MuonParticleExtended() : sigmaEta_(-99), sigmaPhi_(-99), quality_(0) {}

L1MuonParticleExtended( const L1MuonParticle& l1mu) : L1MuonParticle(l1mu), sigmaEta_(-99), sigmaPhi_(-99), quality_(0) {}

virtual ~L1MuonParticleExtended() {}


struct StationData {
StationData() : station(-1), ringOrWheel(-99), bx(-99), quality(-99),
phi(-99), sigmaPhi(-99),
eta(-99), sigmaEta(-99),
bendPhi(-99), bendEta(-99),
bendPhiInt(-99), bendEtaInt(-99),
valid(false) {}
DetId id;
int station; //a bit wasteful
int ringOrWheel;
int bx;
int quality;
float phi;
float sigmaPhi;
float eta;
float sigmaEta;
float bendPhi; //! direction.phi - position.phi
float bendEta; //! direction.eta - position.eta

int bendPhiInt; //magic word from primitives about phi direction
int bendEtaInt; //magic word from primitives about eta or theta direction

bool valid;
};

// ---------- const member functions ---------------------
virtual L1MuonParticleExtended* clone() const
{ return new L1MuonParticleExtended( *this ) ; }

// ---------- member functions ---------------------------
const L1MuRegionalCand& cscCand() const {return cscCand_;}
void setCscCand(const L1MuRegionalCand& cand) {cscCand_ = cand;}

const L1MuRegionalCand& rpcCand() const {return rpcCand_;}
void setRpcCand(const L1MuRegionalCand& cand) {rpcCand_ = cand;}

const L1MuRegionalCand& dtCand() const {return dtCand_;}
void setDtCand(const L1MuRegionalCand& cand) {dtCand_ = cand;}

float sigmaEta() const { return sigmaEta_; }
void setSigmaEta(float val) {sigmaEta_ = val;}

float sigmaPhi() const { return sigmaPhi_; }
void setSigmaPhi(float val) {sigmaPhi_ = val;}

unsigned int quality() const {return quality_;}
void setQuality(unsigned int q) {quality_ = q;}

const StationData& cscData(unsigned int s ) const {return (s>0 && s<= 4) ? cscData_[s-1] : dummyData_; }
void setCscData(const StationData& sd, unsigned int s) {if (s>0 && s<= 4) cscData_[s-1] = sd; }

const StationData& dtData(unsigned int s ) const {return (s>0 && s<= 4) ? dtData_[s-1] : dummyData_; }
void setDtData(const StationData& sd, unsigned int s) {if (s>0 && s<= 4) dtData_[s-1] = sd; }

const StationData& rpcData(unsigned int s ) const {return (s>0 && s<= 4) ? rpcData_[s-1] : dummyData_; }
void setRpcData(const StationData& sd, unsigned int s) {if (s>0 && s<= 4) rpcData_[s-1] = sd; }
private:
// ---------- member data --------------------------------
L1MuRegionalCand cscCand_;
L1MuRegionalCand rpcCand_;
L1MuRegionalCand dtCand_;

float sigmaEta_;
float sigmaPhi_;

unsigned int quality_;

StationData cscData_[4];
StationData dtData_[4];
StationData rpcData_[4];

StationData dummyData_;
};
}

#endif
25 changes: 25 additions & 0 deletions DataFormats/L1Trigger/interface/L1MuonParticleExtendedFwd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#ifndef L1Trigger_L1MuonParticleExtendedFwd_h
#define L1Trigger_L1MuonParticleExtendedFwd_h
// -*- C++ -*-
//
// Package: L1Trigger
// Class : L1MuonParticleExtendedFwd
//

#include <vector>
#include "DataFormats/Common/interface/Ref.h"
#include "DataFormats/Common/interface/RefVector.h"


namespace l1extra {

class L1MuonParticleExtended ;

typedef std::vector< L1MuonParticleExtended > L1MuonParticleExtendedCollection ;

typedef edm::Ref< L1MuonParticleExtendedCollection > L1MuonParticleExtendedRef ;
typedef edm::RefVector< L1MuonParticleExtendedCollection > L1MuonParticleExtendedRefVector ;
typedef std::vector< L1MuonParticleExtendedRef > L1MuonParticleExtendedVectorRef ;
}

#endif
8 changes: 8 additions & 0 deletions DataFormats/L1Trigger/src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleExtended.h"
#include "DataFormats/L1Trigger/interface/L1MuonParticleExtendedFwd.h"
#include "DataFormats/L1Trigger/interface/L1EtMissParticle.h"
#include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h"
#include "DataFormats/L1Trigger/interface/L1ParticleMap.h"
Expand All @@ -29,6 +31,7 @@ namespace {
l1extra::L1EmParticleCollection emColl ;
l1extra::L1JetParticleCollection jetColl ;
l1extra::L1MuonParticleCollection muonColl ;
l1extra::L1MuonParticleExtendedCollection muonCollE ;
l1extra::L1EtMissParticle etMiss ;
l1extra::L1EtMissParticleCollection etMissColl ;
l1extra::L1ParticleMapCollection mapColl ;
Expand All @@ -37,6 +40,7 @@ namespace {
edm::Wrapper<l1extra::L1EmParticleCollection> w_emColl;
edm::Wrapper<l1extra::L1JetParticleCollection> w_jetColl;
edm::Wrapper<l1extra::L1MuonParticleCollection> w_muonColl;
edm::Wrapper<l1extra::L1MuonParticleExtendedCollection> w_muonCollE;
edm::Wrapper<l1extra::L1EtMissParticle> w_etMiss;
edm::Wrapper<l1extra::L1EtMissParticleCollection> w_etMissColl;
edm::Wrapper<l1extra::L1ParticleMapCollection> w_mapColl;
Expand All @@ -45,25 +49,29 @@ namespace {
l1extra::L1EmParticleRef refEm ;
l1extra::L1JetParticleRef refJet ;
l1extra::L1MuonParticleRef refMuon ;
l1extra::L1MuonParticleExtendedRef refMuonE ;
l1extra::L1EtMissParticleRef refEtMiss ;
l1extra::L1HFRingsRef refHFRings ;

l1extra::L1EmParticleRefVector refVecEmColl ;
l1extra::L1JetParticleRefVector refVecJetColl ;
l1extra::L1MuonParticleRefVector refVecMuonColl ;
l1extra::L1MuonParticleExtendedRefVector refVecMuonCollE ;
l1extra::L1EtMissParticleRefVector refVecEtMiss ;
l1extra::L1HFRingsRefVector refVecHFRings ;

l1extra::L1EmParticleVectorRef vecRefEmColl ;
l1extra::L1JetParticleVectorRef vecRefJetColl ;
l1extra::L1MuonParticleVectorRef vecRefMuonColl ;
l1extra::L1MuonParticleExtendedVectorRef vecRefMuonCollE ;
l1extra::L1EtMissParticleVectorRef vecRefEtMissColl ;
l1extra::L1HFRingsVectorRef vecRefHFRingsColl ;

l1extra::L1EtMissParticleRefProd refProdEtMiss ;

edm::reftobase::Holder<reco::Candidate, l1extra::L1EmParticleRef> rtbe;
edm::reftobase::Holder<reco::Candidate, l1extra::L1MuonParticleRef> rtbm;
edm::reftobase::Holder<reco::Candidate, l1extra::L1MuonParticleExtendedRef> rtbmE;
edm::reftobase::Holder<reco::Candidate, l1extra::L1JetParticleRef> rtbj;
edm::reftobase::Holder<reco::Candidate, l1extra::L1EtMissParticleRef> rtbm1;
edm::reftobase::Holder<reco::Candidate, l1extra::L1EtMissParticleRefProd> rtbm2;
Expand Down
Loading

0 comments on commit f3d240d

Please sign in to comment.