Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Me0 muons in 76 x commitv2 #11398

Merged
merged 46 commits into from
Oct 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ef4e58a
MyCmsDriverCommands/runGEMRecHitProducer_cfg.py
pietverwilligen Sep 11, 2015
f2eb007
adding nocalo digitization
pietverwilligen Sep 11, 2015
548b01b
reintroducing me0customs, for now without global me0muon
pietverwilligen Sep 11, 2015
610274c
updated version
pietverwilligen Sep 11, 2015
1b3a539
updated version
pietverwilligen Sep 11, 2015
f1c8191
ME0Segment now in GEMSegment not in GEMRecHit
pietverwilligen Sep 11, 2015
8e95d4a
updated version
pietverwilligen Sep 14, 2015
2357392
update
pietverwilligen Sep 14, 2015
5ff5f39
split GEM-SIM-DIGI step
pietverwilligen Sep 14, 2015
04bbf71
split GEM-SIM-DIGI step
pietverwilligen Sep 14, 2015
d2d0d4a
customization for digitization of TRK + MUO detectors
pietverwilligen Sep 14, 2015
a233202
GEN-SIM-DIGI step for TRK+MUO detectors, not working because of Oscar…
pietverwilligen Sep 14, 2015
9c349aa
GEN-SIM step for TRK+MUO detectors, working
pietverwilligen Sep 14, 2015
0471433
Muon + Tracker Local reco for TRK+MUO detectors, working
pietverwilligen Sep 14, 2015
e77a08c
DIGI step for TRK+MUO detectors, working
pietverwilligen Sep 14, 2015
f4d631e
add more LogTrace
pietverwilligen Sep 17, 2015
1d6fad1
hide call to calorimeter geometry behind parameters
pietverwilligen Sep 17, 2015
e674270
hide call to calorimeter geometry behind parameters
pietverwilligen Sep 17, 2015
3795824
able to run iterTracking step :-)
pietverwilligen Sep 17, 2015
aee308f
now also vertexing is working
pietverwilligen Sep 18, 2015
a8a4caf
commented out Run-II config and restored Run-I config
pietverwilligen Sep 18, 2015
3d72027
Include ME0MuonTrackCollProducer
dnash86 Sep 18, 2015
64aa890
DataFormats for EmulatedME0Segment and ME0Muon
dnash86 Sep 18, 2015
681731b
ME0Muon code
dnash86 Sep 18, 2015
6aea60b
Working runRecoLocalMuon_cfg for ME0Muon prod
dnash86 Sep 18, 2015
b3162a4
Name change
dnash86 Sep 18, 2015
39f402f
Name change
dnash86 Sep 18, 2015
f800de0
Remove non ME0 changes
dnash86 Sep 21, 2015
6aba8b0
Cleanup
dnash86 Sep 21, 2015
87779df
Cleanup
dnash86 Sep 21, 2015
e2365f5
Cleanup
dnash86 Sep 21, 2015
84d9d43
Cleanup
dnash86 Sep 21, 2015
f42b1b1
Cleanup
dnash86 Sep 21, 2015
2b8e3c3
Cleanup
dnash86 Sep 21, 2015
92c813a
Cleanup
dnash86 Sep 21, 2015
cc1fcc2
Restore RecoAlgos
dnash86 Sep 21, 2015
75fab0e
Fix previous erroneous attempt to fix merge conflict
dnash86 Sep 22, 2015
fae4e99
Comments on CommonTools/RecoAlgos
dnash86 Oct 1, 2015
760c04e
Comments on DataFormats/MuonReco
dnash86 Oct 1, 2015
ac4a80d
Comments on RecoMuon/MuonIdentification
dnash86 Oct 1, 2015
b528467
Comments on SLHCUpgradeSimulations/Configuration
dnash86 Oct 1, 2015
3525f39
Comments on SimMuon/GEMDigitizer
dnash86 Oct 1, 2015
5583b5a
Final updates, remove straggling header refs, etc.
dnash86 Oct 3, 2015
a8e82d1
Remove a few commented out lines
dnash86 Oct 3, 2015
55922b1
git commit RecoMuon/MuonIdentification/plugins/ME0SegmentMatcher.cc
dnash86 Oct 6, 2015
1c3e42f
Second iteration of comments
dnash86 Oct 6, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions CommonTools/RecoAlgos/plugins/ME0MuonTrackCollProducer.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
#include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "RecoMuon/MuonIdentification/plugins/ME0MuonSelector.cc"
#include "FWCore/Framework/interface/ESHandle.h"

#include <sstream>

#include <memory>
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
#include "DataFormats/MuonReco/interface/ME0Muon.h"
#include "DataFormats/MuonReco/interface/ME0MuonCollection.h"
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"

class ME0MuonTrackCollProducer : public edm::stream::EDProducer<> {
public:
explicit ME0MuonTrackCollProducer(const edm::ParameterSet&);
//std::vector<double> findSimVtx(edm::Event& iEvent);
~ME0MuonTrackCollProducer();

private:
virtual void produce(edm::Event&, const edm::EventSetup&) override;
edm::Handle <std::vector<reco::ME0Muon> > OurMuons;
//edm::Handle<reco::ME0MuonCollection> muonCollectionH;
edm::InputTag OurMuonsTag;
std::vector<std::string> selectionTags;
const edm::ParameterSet parset_;
edm::EDGetTokenT<ME0MuonCollection> OurMuonsToken_;
};


#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"

DEFINE_FWK_MODULE(ME0MuonTrackCollProducer);


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move the contents of ME0MuonTrackCollProducer.h here in the .cc file and the contents of the SealModule.cc file as well.
These extra two files are not really needed.

ME0MuonTrackCollProducer::ME0MuonTrackCollProducer(const edm::ParameterSet& parset) :
OurMuonsTag(parset.getParameter<edm::InputTag>("me0MuonTag")),
selectionTags(parset.getParameter< std::vector<std::string> >("selectionTags")),
parset_(parset)
{
produces<reco::TrackCollection>();
OurMuonsToken_ = consumes<ME0MuonCollection>(OurMuonsTag);
}

ME0MuonTrackCollProducer::~ME0MuonTrackCollProducer() {
}

void ME0MuonTrackCollProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
{
using namespace reco;
using namespace edm;
Handle <ME0MuonCollection> OurMuons;
iEvent.getByToken(OurMuonsToken_,OurMuons);


std::auto_ptr<reco::TrackCollection> selectedTracks(new reco::TrackCollection);

reco::TrackRefProd rTracks = iEvent.getRefBeforePut<reco::TrackCollection>();



for(std::vector<reco::ME0Muon>::const_iterator thismuon = OurMuons->begin();
thismuon != OurMuons->end(); ++thismuon) {

if (!muon::isGoodMuon(*thismuon, muon::Tight)) continue;
reco::TrackRef trackref;

if (thismuon->innerTrack().isNonnull()) trackref = thismuon->innerTrack();

const reco::Track* trk = &(*trackref);
// pointer to old track:
//reco::Track* newTrk = new reco::Track(*trk);

selectedTracks->push_back( *trk );
//selectedTrackExtras->push_back( *newExtra );
}
iEvent.put(selectedTracks);

}
12 changes: 12 additions & 0 deletions CommonTools/RecoAlgos/python/me0Associator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import FWCore.ParameterSet.Config as cms


#----------ME0Muon Collection Production for association by chi2
me0muon = cms.EDProducer("ME0MuonTrackCollProducer",
me0MuonTag = cms.InputTag("me0SegmentMatching"),
selectionTags = cms.vstring('All'),
)
#--------------------
me0muonColl_seq = cms.Sequence(
me0muon
)
2 changes: 1 addition & 1 deletion DataFormats/MuonReco/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<use name="DataFormats/TrackReco"/>
<use name="DataFormats/DTRecHit"/>
<use name="DataFormats/CSCRecHit"/>
<use name="DataFormats/GEMRecHit"/>
<use name="DataFormats/VertexReco"/>

<use name="rootmath"/>
<export>
<lib name="1"/>
Expand Down
76 changes: 76 additions & 0 deletions DataFormats/MuonReco/interface/EmulatedME0Segment.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#ifndef DataFormats_MuonReco_EmulatedME0Segment_h
#define DataFormats_MuonReco_EmulatedME0Segment_h

/** \class EmulatedME0Segment
* Describes a simulated track segment in a z-plane modeling an ME0 chamber.
* It is modeled after CSCSegment, so it is a 4-dimensional object ( origin (x,y) , direction (x,y) )
* Formally it must be defined as a LocalPoint and LocalError but we actually use the global coordinate system.
*
*
* \author David Nash
*/

#include <DataFormats/TrackingRecHit/interface/RecSegment.h>

#include <iosfwd>

class EmulatedME0Segment : public RecSegment {

public:

/// Default constructor
EmulatedME0Segment() : theOrigin(0,0,0), theLocalDirection(0,0,0), theCovMatrix(4,0),theChi2(0.) {}

/// Constructor
EmulatedME0Segment(const LocalPoint& origin, const LocalVector& direction, const AlgebraicSymMatrix& errors, const double chi2);

/// Destructor
virtual ~EmulatedME0Segment();

//--- Base class interface
EmulatedME0Segment* clone() const { return new EmulatedME0Segment(*this); }

virtual LocalPoint localPosition() const { return theOrigin; }
LocalError localPositionError() const ;

LocalVector localDirection() const { return theLocalDirection; }
LocalError localDirectionError() const ;

/// Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
AlgebraicVector parameters() const;

/// Covariance matrix of parameters()
virtual AlgebraicSymMatrix parametersError() const { return theCovMatrix; }

/// The projection matrix relates the trajectory state parameters to the segment parameters().
AlgebraicMatrix projectionMatrix() const;

virtual std::vector<const TrackingRecHit*> recHits() const {return std::vector<const TrackingRecHit*> (); }

virtual std::vector<TrackingRecHit*> recHits() {return std::vector<TrackingRecHit*>();}

virtual double chi2() const { return theChi2; }

virtual int dimension() const { return 4; }

virtual int degreesOfFreedom() const { return -1;} //Maybe change later?

//--- Extension of the interface

int nRecHits() const { return 0;} //theME0RecHits.size(); }

void print() const;

private:

//std::vector<ME0RecHit2D> theME0RecHits;
// CAVEAT: these "Local" paramaters will in fact be filled by global coordinates
LocalPoint theOrigin; // in chamber frame - the GeomDet local coordinate system
LocalVector theLocalDirection; // in chamber frame - the GeomDet local coordinate system
AlgebraicSymMatrix theCovMatrix; // the covariance matrix
double theChi2;
};

std::ostream& operator<<(std::ostream& os, const EmulatedME0Segment& seg);

#endif // ME0RecHit_EmulatedME0Segment_h
23 changes: 23 additions & 0 deletions DataFormats/MuonReco/interface/EmulatedME0SegmentCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

#ifndef DataFormats_EmulatedME0SegmentCollection_H
#define DataFormats_EmulatedME0SegmentCollection_H

/** \class EmulatedME0SegmentCollection
*
* The collection of EmulatedME0Segment's. See \ref EmulatedME0SegmentCollection.h for details.
*
* \author Matteo Sani
*/

#include <DataFormats/MuonReco/interface/EmulatedME0Segment.h>
#include <DataFormats/Common/interface/Ref.h>

/// collection of EmulatedME0Segments
typedef std::vector<EmulatedME0Segment> EmulatedME0SegmentCollection;

/// persistent reference to a EmulatedME0Segment
typedef edm::Ref<EmulatedME0SegmentCollection> EmulatedME0SegmentRef;

#endif


87 changes: 87 additions & 0 deletions DataFormats/MuonReco/interface/ME0Muon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#ifndef MuonReco_ME0Muon_h
#define MuonReco_ME0Muon_h
/** \class reco::ME0Muon ME0Muon.h DataFormats/MuonReco/interface/ME0Muon.h
*
* \author David Nash NEU
*
*
*/
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackReco/interface/Track.h"
#include "DataFormats/GeometryVector/interface/GlobalPoint.h"
#include "DataFormats/GeometryVector/interface/GlobalVector.h"
#include "DataFormats/Math/interface/AlgebraicROOTObjects.h"

#include <DataFormats/GEMRecHit/interface/ME0SegmentCollection.h>

#include "DataFormats/RecoCandidate/interface/RecoCandidate.h"

namespace reco {

class ME0Muon : public RecoCandidate{
public:
ME0Muon();
//ME0Muon( const TrackRef & t, const ME0Segment & s) { innerTrack_ = t; me0Segment_ = s;}
ME0Muon( const TrackRef & t, const ME0Segment & s, const int v, const double c) { innerTrack_ = t; me0Segment_ = s; me0segid_=v; trackCharge_ = c;}
virtual ~ME0Muon(){}

/// reference to Track reconstructed in the tracker only
TrackRef innerTrack() const { return innerTrack_; }
virtual TrackRef track() const { return innerTrack(); }
/// set reference to Track
void setInnerTrack( const TrackRef & t ) { innerTrack_ = t; }
void setTrack( const TrackRef & t ) { setInnerTrack(t); }
/// set reference to our new ME0Segment type
void setME0Segment( const ME0Segment & s ) { me0Segment_ = s; }

const ME0Segment& me0segment() const { return me0Segment_; }

//Added for testing
void setme0segid( const int v){me0segid_=v;}
int me0segid() const {return me0segid_;}


const GlobalPoint& globalTrackPosAtSurface() const { return globalTrackPosAtSurface_; }
const GlobalVector& globalTrackMomAtSurface() const { return globalTrackMomAtSurface_; }
const LocalPoint& localTrackPosAtSurface() const { return localTrackPosAtSurface_; }
const LocalVector& localTrackMomAtSurface() const { return localTrackMomAtSurface_; }

int trackCharge() const { return trackCharge_; }
const AlgebraicSymMatrix66& globalTrackCov() const { return globalTrackCov_; }
const AlgebraicSymMatrix55& localTrackCov() const { return localTrackCov_; }

void setGlobalTrackPosAtSurface(const GlobalPoint& globalTrackPosAtSurface) { globalTrackPosAtSurface_ = globalTrackPosAtSurface; }
void setGlobalTrackMomAtSurface(const GlobalVector& globalTrackMomAtSurface) { globalTrackMomAtSurface_ = globalTrackMomAtSurface; }
void setLocalTrackPosAtSurface(const LocalPoint& localTrackPosAtSurface) { localTrackPosAtSurface_ = localTrackPosAtSurface; }
void setLocalTrackMomAtSurface(const LocalVector& localTrackMomAtSurface) { localTrackMomAtSurface_ = localTrackMomAtSurface; }
void setTrackCharge(const int& trackCharge) { trackCharge_ = trackCharge; }
void setGlobalTrackCov(const AlgebraicSymMatrix66& trackCov) { globalTrackCov_ = trackCov; }
void setLocalTrackCov(const AlgebraicSymMatrix55& trackCov) { localTrackCov_ = trackCov; }

private:
/// check overlap with another candidate
virtual bool overlap( const Candidate & ) const;

/// reference to Track reconstructed in the tracker only
TrackRef innerTrack_;
ME0Segment me0Segment_;
int me0segid_;

GlobalPoint globalTrackPosAtSurface_;
GlobalVector globalTrackMomAtSurface_;

LocalPoint localTrackPosAtSurface_;
LocalVector localTrackMomAtSurface_;
int trackCharge_;
AlgebraicSymMatrix66 globalTrackCov_;
AlgebraicSymMatrix55 localTrackCov_;

//double xpull_,ypull_,xdiff_,ydiff_,phidirdiff_;
};

}


#endif


22 changes: 22 additions & 0 deletions DataFormats/MuonReco/interface/ME0MuonCollection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef DataFormats_ME0MuonCollection_H
#define DataFormats_ME0MuonCollection_H

/** \class ME0MuonCollection
*
* The collection of ME0Muon's. See \ref ME0MuonCollection.h for details.
*
* $Date: 2010/03/12 13:08:15 $
* \author David Nash
*/

#include "DataFormats/MuonReco/interface/ME0Muon.h"
#include "DataFormats/Common/interface/Ref.h"

/// collection of ME0Muons
typedef std::vector<reco::ME0Muon> ME0MuonCollection;

/// persistent reference to a ME0Muon
typedef edm::Ref<ME0MuonCollection> ME0MuonRef;


#endif
Loading