-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8912 from archiesharma/CodeforME0
adding ME0 for recolocal
- Loading branch information
Showing
17 changed files
with
634 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#ifndef DataFormats_ME0RecHit_H | ||
#define DataFormats_ME0RecHit_H | ||
|
||
/** \class ME0RecHit | ||
* | ||
* RecHit for ME0 | ||
* | ||
* $Date: 2014/02/03 16:54:23 $ | ||
* $Revision: 1.1 $ | ||
* \author M. Maggi -- INFN Bari | ||
*/ | ||
|
||
#include "DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h" | ||
#include "DataFormats/MuonDetId/interface/ME0DetId.h" | ||
|
||
|
||
class ME0RecHit : public RecHit2DLocalPos { | ||
public: | ||
|
||
ME0RecHit(const ME0DetId& me0Id, | ||
float tof); | ||
|
||
/// Default constructor | ||
ME0RecHit(); | ||
|
||
/// Constructor from a local position, ME0Id and digi time. | ||
ME0RecHit(const ME0DetId& me0Id, | ||
float tof, | ||
const LocalPoint& pos); | ||
|
||
|
||
/// Constructor from a local position and error, ME0Id and tof. | ||
/// The 3-dimensional local error is defined as | ||
/// resolution (the cell resolution) for the coordinate being measured | ||
/// and 0 for the two other coordinates | ||
ME0RecHit(const ME0DetId& me0Id, | ||
float tof, | ||
const LocalPoint& pos, | ||
const LocalError& err); | ||
|
||
|
||
/// Destructor | ||
virtual ~ME0RecHit(); | ||
|
||
|
||
/// Return the 3-dimensional local position | ||
virtual LocalPoint localPosition() const { | ||
return theLocalPosition; | ||
} | ||
|
||
|
||
/// Return the 3-dimensional error on the local position | ||
virtual LocalError localPositionError() const { | ||
return theLocalError; | ||
} | ||
|
||
|
||
virtual ME0RecHit* clone() const; | ||
|
||
|
||
/// Access to component RecHits. | ||
/// No components rechits: it returns a null vector | ||
virtual std::vector<const TrackingRecHit*> recHits() const; | ||
|
||
|
||
/// Non-const access to component RecHits. | ||
/// No components rechits: it returns a null vector | ||
virtual std::vector<TrackingRecHit*> recHits(); | ||
|
||
|
||
/// Set local position | ||
void setPosition(LocalPoint pos) { | ||
theLocalPosition = pos; | ||
} | ||
|
||
|
||
/// Set local position error | ||
void setError(LocalError err) { | ||
theLocalError = err; | ||
} | ||
|
||
|
||
/// Set the local position and its error | ||
void setPositionAndError(LocalPoint pos, LocalError err) { | ||
theLocalPosition = pos; | ||
theLocalError = err; | ||
} | ||
|
||
|
||
/// Return the gemId | ||
ME0DetId me0Id() const { | ||
return theME0Id; | ||
} | ||
|
||
float tof() const { | ||
return theTOF; | ||
} | ||
|
||
/// Comparison operator, based on the gemId and the digi time | ||
bool operator==(const ME0RecHit& hit) const; | ||
|
||
private: | ||
ME0DetId theME0Id; | ||
float theTOF; | ||
// Position and error in the Local Ref. Frame of the ME0Layer | ||
LocalPoint theLocalPosition; | ||
LocalError theLocalError; | ||
|
||
}; | ||
#endif | ||
|
||
/// The ostream operator | ||
std::ostream& operator<<(std::ostream& os, const ME0RecHit& hit); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef DataFormats_ME0RecHitCollection_H | ||
#define DataFormats_ME0RecHitCollection_H | ||
|
||
/** \class ME0RecHitCollection | ||
* Collection of ME0RecHit for storage in the event | ||
* | ||
* $Date: 2013/04/24 16:54:23 $ | ||
* $Revision: 1.1 $ | ||
* \author M. Maggi - INFN Bari | ||
*/ | ||
|
||
|
||
#include "DataFormats/MuonDetId/interface/ME0DetId.h" | ||
#include "DataFormats/GEMRecHit/interface/ME0RecHit.h" | ||
#include "DataFormats/Common/interface/RangeMap.h" | ||
#include "DataFormats/Common/interface/ClonePolicy.h" | ||
#include "DataFormats/Common/interface/OwnVector.h" | ||
#include <functional> | ||
|
||
typedef edm::RangeMap <ME0DetId, | ||
edm::OwnVector<ME0RecHit,edm::ClonePolicy<ME0RecHit> >, | ||
edm::ClonePolicy<ME0RecHit> > ME0RecHitCollection; | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* See header file for a description of this class. | ||
* | ||
* $Date: 2013/04/24 16:54:24 $ | ||
* $Revision: 1.1 $ | ||
* \author M. Maggi -- INFN Bari | ||
*/ | ||
|
||
|
||
#include "DataFormats/GEMRecHit/interface/ME0RecHit.h" | ||
|
||
|
||
ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof) : RecHit2DLocalPos(me0Id), | ||
theME0Id(me0Id), theTOF(tof), theLocalPosition(), theLocalError() | ||
{ | ||
} | ||
|
||
ME0RecHit::ME0RecHit() : RecHit2DLocalPos(), | ||
theME0Id(), theTOF(0.), theLocalPosition(), theLocalError() | ||
{ | ||
} | ||
|
||
|
||
ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof, const LocalPoint& pos) : RecHit2DLocalPos(me0Id), | ||
theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError() | ||
{ | ||
} | ||
|
||
|
||
|
||
// Constructor from a local position and error, wireId and digi time. | ||
ME0RecHit::ME0RecHit(const ME0DetId& me0Id, | ||
float tof, | ||
const LocalPoint& pos, | ||
const LocalError& err) : RecHit2DLocalPos(me0Id), | ||
theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError(err) | ||
{ | ||
} | ||
|
||
// Destructor | ||
ME0RecHit::~ME0RecHit() | ||
{ | ||
} | ||
|
||
|
||
|
||
ME0RecHit * ME0RecHit::clone() const { | ||
return new ME0RecHit(*this); | ||
} | ||
|
||
|
||
// Access to component RecHits. | ||
// No components rechits: it returns a null vector | ||
std::vector<const TrackingRecHit*> ME0RecHit::recHits() const { | ||
std::vector<const TrackingRecHit*> nullvector; | ||
return nullvector; | ||
} | ||
// Non-const access to component RecHits. | ||
// No components rechits: it returns a null vector | ||
std::vector<TrackingRecHit*> ME0RecHit::recHits() { | ||
std::vector<TrackingRecHit*> nullvector; | ||
return nullvector; | ||
} | ||
|
||
// Comparison operator, based on the wireId and the digi time | ||
bool ME0RecHit::operator==(const ME0RecHit& hit) const { | ||
return this->geographicalId() == hit.geographicalId(); | ||
} | ||
|
||
|
||
// The ostream operator | ||
std::ostream& operator<<(std::ostream& os, const ME0RecHit& hit) { | ||
os << "pos: x = " << hit.localPosition().x() ; | ||
os << " +/- " << sqrt(hit.localPositionError().xx())<<" cm"; | ||
os<< " y = " << hit.localPosition().y() ; | ||
os << " +/- " << sqrt(hit.localPositionError().yy())<<" cm"; | ||
return os; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
#include "DataFormats/GEMRecHit/interface/GEMRecHit.h" | ||
#include "DataFormats/GEMRecHit/interface/GEMRecHitCollection.h" | ||
#include "DataFormats/GEMRecHit/interface/ME0RecHit.h" | ||
#include "DataFormats/GEMRecHit/interface/ME0RecHitCollection.h" | ||
#include "DataFormats/Common/interface/Wrapper.h" | ||
|
||
namespace DataFormats_GEMRecHit { | ||
namespace { | ||
struct dictionary { | ||
std::pair<unsigned int, unsigned int> dummyrpc1; | ||
std::pair<unsigned long, unsigned long> dummyrpc2; | ||
std::map<GEMDetId, std::pair<unsigned int, unsigned int> > dummyrpcdetid1; | ||
std::map<GEMDetId, std::pair<unsigned long, unsigned long> > dummyrpcdetid2; | ||
std::map<ME0DetId, std::pair<unsigned int, unsigned int> > dummyme0detid1; | ||
std::map<ME0DetId, std::pair<unsigned long, unsigned long> > dummyme0detid2; | ||
|
||
GEMRecHit rrh; | ||
std::vector<GEMRecHit> vrh; | ||
GEMRecHitCollection c; | ||
edm::Wrapper<GEMRecHitCollection> w; | ||
|
||
ME0RecHit mrh; | ||
std::vector<ME0RecHit> vmrh; | ||
ME0RecHitCollection mc; | ||
edm::Wrapper<ME0RecHitCollection> mw; | ||
|
||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef RecoLocalMuon_ME0RecHitAlgoFactory_H | ||
#define RecoLocalMuon_ME0RecHitAlgoFactory_H | ||
|
||
/** \class ME0RecHitAlgoFactory | ||
* Factory of seal plugins for 1D RecHit reconstruction algorithms. | ||
* The plugins are concrete implementations of ME0RecHitBaseAlgo base class. | ||
* | ||
* $Date: 2014/02/04 10:16:32 $ | ||
* $Revision: 1.1 $ | ||
* \author M. Maggi - INFN Torino | ||
*/ | ||
#include "FWCore/PluginManager/interface/PluginFactory.h" | ||
#include "RecoLocalMuon/GEMRecHit/interface/ME0RecHitBaseAlgo.h" | ||
|
||
typedef edmplugin::PluginFactory<ME0RecHitBaseAlgo *(const edm::ParameterSet &)> ME0RecHitAlgoFactory; | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#ifndef RecoLocalMuon_ME0RecHitBaseAlgo_H | ||
#define RecoLocalMuon_ME0RecHitBaseAlgo_H | ||
|
||
/** \class ME0RecHitBaseAlgo | ||
* Abstract algorithmic class to compute Rec Hit | ||
* form a ME0 digi | ||
* | ||
* $Date: 2014/02/04 10:16:32 $ | ||
* $Revision: 1.1 $ | ||
* \author M. Maggi -- INFN Bari | ||
*/ | ||
|
||
|
||
#include "DataFormats/GeometryVector/interface/LocalPoint.h" | ||
#include "DataFormats/GeometrySurface/interface/LocalError.h" | ||
#include "DataFormats/GeometryVector/interface/GlobalPoint.h" | ||
#include "DataFormats/GEMDigi/interface/ME0DigiPreRecoCollection.h" | ||
#include "DataFormats/GEMRecHit/interface/ME0RecHit.h" | ||
#include "DataFormats/Common/interface/OwnVector.h" | ||
|
||
class ME0DetId; | ||
|
||
namespace edm { | ||
class ParameterSet; | ||
class EventSetup; | ||
} | ||
|
||
|
||
class ME0RecHitBaseAlgo { | ||
|
||
public: | ||
|
||
/// Constructor | ||
ME0RecHitBaseAlgo(const edm::ParameterSet& config); | ||
|
||
/// Destructor | ||
virtual ~ME0RecHitBaseAlgo(); | ||
|
||
/// Pass the Event Setup to the algo at each event | ||
virtual void setES(const edm::EventSetup& setup) = 0; | ||
|
||
/// Build all hits in the range associated to the me0Id, at the 1st step. | ||
virtual edm::OwnVector<ME0RecHit> reconstruct(const ME0DetId& me0Id, | ||
const ME0DigiPreRecoCollection::Range& digiRange); | ||
|
||
/// standard local recHit computation | ||
virtual bool compute(const ME0DigiPreReco& digi, | ||
LocalPoint& Point, | ||
LocalError& error) const = 0; | ||
|
||
}; | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
from RecoLocalMuon.GEMRecHit.me0RecHits_cfi import * | ||
from RecoLocalMuon.GEMRecHit.me0Segments_cfi import * | ||
|
||
me0LocalReco = cms.Sequence(me0RecHits*me0Segments) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
me0RecHits = cms.EDProducer("ME0RecHitProducer", | ||
recAlgoConfig = cms.PSet(), | ||
recAlgo = cms.string('ME0RecHitStandardAlgo'), | ||
me0DigiLabel = cms.InputTag("simMuonME0Digis"), | ||
) |
Oops, something went wrong.