-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Phase2 Outer Tracker Clusterizer integration in CMSSW 8 #13087
Changes from all commits
78050c0
8197293
fc94e1c
b408a53
8628a59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<use name="DataFormats/Common"/> | ||
<use name="rootrflx"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#ifndef DATAFORMATS_PHASE2TRACKERCLUSTER_PHASE2TRACKERCLUSTER1D_H | ||
#define DATAFORMATS_PHASE2TRACKERCLUSTER_PHASE2TRACKERCLUSTER1D_H | ||
|
||
#include <cstdint> | ||
|
||
#include "DataFormats/Common/interface/DetSetVectorNew.h" | ||
|
||
#include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" | ||
|
||
class Phase2TrackerCluster1D { | ||
|
||
public: | ||
|
||
Phase2TrackerCluster1D() : data_(0) { } | ||
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size) : firstDigi_(row, col), data_((size & 0x7fff)) { } | ||
Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold) : firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) { } | ||
Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size) : firstDigi_(firstDigi), data_((size & 0x7fff)) { } | ||
Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold) : firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) { } | ||
|
||
const Phase2TrackerDigi& firstDigi() const { return firstDigi_; } | ||
unsigned int firstStrip() const { return firstDigi_.strip(); } | ||
unsigned int firstRow() const { return firstDigi_.row(); } | ||
unsigned int edge() const { return firstDigi_.edge(); } | ||
unsigned int column() const { return firstDigi_.column(); } | ||
uint16_t size() const { return (data_ & 0x7fff); } | ||
uint16_t threshold() const { return ((data_ >> 15) & 0x1); } | ||
float center() const { return firstStrip() + (data_ & 0x7fff) / 2.; } | ||
std::pair< float, float > barycenter() const { return std::make_pair(column(), center()); } | ||
|
||
private: | ||
|
||
Phase2TrackerDigi firstDigi_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Logically, it's not the best way to indicate the first channel. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is quite unlikely for the Phase2TrackerDigi to evolve into something more complex. The digi class was developed together with the unpacker and the raw dataformat is more or less frozen. The main reason to use Phase2TrackerDigi was to ensure consistency in the underlying dataformat, but that's not a strong argument. |
||
uint16_t data_; | ||
|
||
}; | ||
|
||
inline bool operator< (const Phase2TrackerCluster1D& one, const Phase2TrackerCluster1D& other) { | ||
return one.firstStrip() < other.firstStrip(); | ||
} | ||
|
||
typedef edmNew::DetSetVector< Phase2TrackerCluster1D > Phase2TrackerCluster1DCollectionNew; | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef DATAFORMATS_PHASE2TRACKERCLUSTER_CLASSES_H | ||
#define DATAFORMATS_PHASE2TRACKERCLUSTER_CLASSES_H | ||
|
||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
#include "DataFormats/Common/interface/Wrapper.h" | ||
#include "DataFormats/Common/interface/DetSetNew.h" | ||
|
||
namespace { | ||
struct dictionary { | ||
edm::Wrapper< Phase2TrackerCluster1D > cl0; | ||
edm::Wrapper< std::vector< Phase2TrackerCluster1D > > cl1; | ||
edm::Wrapper< edmNew::DetSet< Phase2TrackerCluster1D > > cl2; | ||
edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerCluster1D > > > cl3; | ||
edm::Wrapper< Phase2TrackerCluster1DCollectionNew > cl4; | ||
}; | ||
} | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<lcgdict> | ||
<class name="Phase2TrackerCluster1D" ClassVersion="2"> | ||
<version ClassVersion="2" checksum="1003486686"/> | ||
</class> | ||
<class name="std::vector< Phase2TrackerCluster1D >"/> | ||
<class name="std::vector< edmNew::DetSet< Phase2TrackerCluster1D > >"/> | ||
<class name="edmNew::DetSet< Phase2TrackerCluster1D >"/> | ||
<class name="edmNew::DetSetVector< Phase2TrackerCluster1D >"/> | ||
<class name="edm::Wrapper< edmNew::DetSet< Phase2TrackerCluster1D > >" splitLevel="0"/> | ||
<class name="edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerCluster1D > > >" splitLevel="0"/> | ||
<class name="edm::Wrapper< edmNew::DetSetVector< Phase2TrackerCluster1D > >"/> | ||
</lcgdict> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<use name="DataFormats/Common"/> | ||
<use name="rootrflx"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef DATAFORMATS_PHASE2TRACKERRECHIT_PHASE2TRACKERRECHIT1D_H | ||
#define DATAFORMATS_PHASE2TRACKERRECHIT_PHASE2TRACKERRECHIT1D_H | ||
|
||
#include "DataFormats/Common/interface/DetSetVectorNew.h" | ||
|
||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
#include "DataFormats/GeometrySurface/interface/LocalError.h" | ||
#include "DataFormats/GeometryVector/interface/LocalPoint.h" | ||
|
||
typedef edm::Ref< edmNew::DetSetVector< Phase2TrackerCluster1D >, Phase2TrackerCluster1D > Phase2ClusterReference; | ||
|
||
class Phase2TrackerRecHit1D { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no connection to TrackingRecHit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just added something minimal. We are far from connecting to the tracking. |
||
|
||
public: | ||
|
||
Phase2TrackerRecHit1D() { } | ||
Phase2TrackerRecHit1D(LocalPoint pos, LocalError err, Phase2ClusterReference cluster) : pos_(pos), err_(err), cluster_(cluster) { } | ||
|
||
LocalPoint localPosition() const { return pos_; } | ||
LocalError localPositionError() const { return err_; } | ||
Phase2ClusterReference cluster() const { return cluster_; } | ||
|
||
private: | ||
|
||
LocalPoint pos_; | ||
LocalError err_; | ||
Phase2ClusterReference cluster_; | ||
|
||
}; | ||
|
||
typedef edmNew::DetSetVector< Phase2TrackerRecHit1D > Phase2TrackerRecHit1DCollectionNew; | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef DATAFORMATS_PHASE2TRACKERRECHIT_CLASSES_H | ||
#define DATAFORMATS_PHASE2TRACKERRECHIT_CLASSES_H | ||
|
||
#include "DataFormats/Phase2TrackerRecHit/interface/Phase2TrackerRecHit1D.h" | ||
#include "DataFormats/Common/interface/Wrapper.h" | ||
#include "DataFormats/Common/interface/DetSetNew.h" | ||
|
||
namespace { | ||
struct dictionary { | ||
edm::Wrapper< Phase2TrackerRecHit1D > cl0; | ||
edm::Wrapper< std::vector< Phase2TrackerRecHit1D > > cl1; | ||
edm::Wrapper< edmNew::DetSet< Phase2TrackerRecHit1D > > cl2; | ||
edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerRecHit1D > > > cl3; | ||
edm::Wrapper< Phase2TrackerRecHit1DCollectionNew > cl4; | ||
}; | ||
} | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<lcgdict> | ||
<class name="Phase2TrackerRecHit1D" ClassVersion="2"> | ||
<version ClassVersion="2" checksum="3085242308"/> | ||
</class> | ||
<class name="std::vector< Phase2TrackerRecHit1D >"/> | ||
<class name="std::vector< edmNew::DetSet< Phase2TrackerRecHit1D > >"/> | ||
<class name="edmNew::DetSet< Phase2TrackerRecHit1D >"/> | ||
<class name="edmNew::DetSetVector< Phase2TrackerRecHit1D >"/> | ||
<class name="edm::Wrapper< edmNew::DetSet< Phase2TrackerRecHit1D > >" splitLevel="0"/> | ||
<class name="edm::Wrapper< std::vector< edmNew::DetSet< Phase2TrackerRecHit1D > > >" splitLevel="0"/> | ||
<class name="edm::Wrapper< edmNew::DetSetVector< Phase2TrackerRecHit1D > >"/> | ||
</lcgdict> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#ifndef RecoLocalTracker_Cluster_Parameter_Estimator_H | ||
#define RecoLocalTracker_Cluster_Parameter_Estimator_H | ||
|
||
#include "DataFormats/GeometrySurface/interface/LocalError.h" | ||
#include "DataFormats/GeometryVector/interface/LocalPoint.h" | ||
|
||
#include "Geometry/CommonDetUnit/interface/GeomDetUnit.h" | ||
#include "DataFormats/TrajectoryState/interface/LocalTrajectoryParameters.h" | ||
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" | ||
|
||
template <class T> | ||
class ClusterParameterEstimator { | ||
|
||
public: | ||
typedef std::pair<LocalPoint,LocalError> LocalValues; | ||
typedef std::vector<LocalValues> VLocalValues; | ||
virtual LocalValues localParameters( const T&,const GeomDetUnit&) const = 0; | ||
virtual LocalValues localParameters( const T& cluster, const GeomDetUnit& gd, const LocalTrajectoryParameters&) const { | ||
return localParameters(cluster,gd); | ||
} | ||
virtual LocalValues localParameters( const T& cluster, const GeomDetUnit& gd, const TrajectoryStateOnSurface& tsos) const { | ||
return localParameters(cluster,gd,tsos.localParameters()); | ||
} | ||
virtual VLocalValues localParametersV( const T& cluster, const GeomDetUnit& gd) const { | ||
VLocalValues vlp; | ||
vlp.push_back(localParameters(cluster,gd)); | ||
return vlp; | ||
} | ||
virtual VLocalValues localParametersV( const T& cluster, const GeomDetUnit& gd, const TrajectoryStateOnSurface& tsos) const { | ||
VLocalValues vlp; | ||
vlp.push_back(localParameters(cluster,gd,tsos.localParameters())); | ||
return vlp; | ||
} | ||
|
||
virtual ~ClusterParameterEstimator(){} | ||
|
||
//methods needed by FastSim | ||
virtual void enterLocalParameters(unsigned int id, std::pair<int,int> | ||
&row_col, LocalValues pos_err_info) const {} | ||
virtual void enterLocalParameters(uint32_t id, uint16_t firstStrip, | ||
LocalValues pos_err_info) const {} | ||
virtual void clearParameters() const {} | ||
|
||
}; | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="RecoLocalTracker/ClusterParameterEstimator"/> | ||
<use name="DataFormats/Phase2TrackerCluster"/> | ||
<use name="DataFormats/Phase2TrackerRecHit"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef RecoLocalTracker_Phase2TrackerRecHits_Phase2StripCPETrivial_H | ||
#define RecoLocalTracker_Phase2TrackerRecHits_Phase2StripCPETrivial_H | ||
|
||
#include "RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h" | ||
#include "Geometry/CommonDetUnit/interface/GeomDetUnit.h" | ||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
|
||
class Phase2StripCPETrivial : public ClusterParameterEstimator<Phase2TrackerCluster1D> { | ||
|
||
public: | ||
|
||
LocalValues localParameters(const Phase2TrackerCluster1D & cluster, const GeomDetUnit & det) const; | ||
|
||
}; | ||
|
||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<use name="Geometry/TrackerGeometryBuilder"/> | ||
<use name="RecoLocalTracker/Records"/> | ||
<use name="RecoLocalTracker/ClusterParameterEstimator"/> | ||
<use name="RecoLocalTracker/Phase2TrackerRecHits"/> | ||
<library file="*.cc" name="RecoLocalTrackerPhase2TrackerRecHitsPlugins"> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include "FWCore/Framework/interface/ESProducer.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
|
||
#include "RecoLocalTracker/Records/interface/TkStripCPERecord.h" | ||
#include "RecoLocalTracker/ClusterParameterEstimator/interface/ClusterParameterEstimator.h" | ||
#include "RecoLocalTracker/Phase2TrackerRecHits/interface/Phase2StripCPETrivial.h" | ||
|
||
#include "DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h" | ||
|
||
#include <boost/shared_ptr.hpp> | ||
|
||
#include <memory> | ||
#include <map> | ||
|
||
class Phase2StripCPEESProducer: public edm::ESProducer { | ||
|
||
public: | ||
|
||
Phase2StripCPEESProducer(const edm::ParameterSet&); | ||
boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > produce(const TkStripCPERecord & iRecord); | ||
|
||
private: | ||
|
||
enum CPE_t { TRIVIAL }; | ||
std::map<std::string, CPE_t> enumMap_; | ||
|
||
CPE_t cpeNum_; | ||
edm::ParameterSet pset_; | ||
boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_; | ||
|
||
}; | ||
|
||
Phase2StripCPEESProducer::Phase2StripCPEESProducer(const edm::ParameterSet & p) { | ||
std::string name = p.getParameter<std::string>("ComponentType"); | ||
|
||
enumMap_[std::string("Phase2StripCPETrivial")] = TRIVIAL; | ||
if (enumMap_.find(name) == enumMap_.end()) | ||
throw cms::Exception("Unknown StripCPE type") << name; | ||
|
||
cpeNum_ = enumMap_[name]; | ||
pset_ = p; | ||
setWhatProduced(this, name); | ||
} | ||
|
||
boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > Phase2StripCPEESProducer::produce(const TkStripCPERecord & iRecord) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. time to move to std::shared_ptr There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if we yet support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked and we haven't supported it yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/cms-sw/cmssw/blob/CMSSW_8_0_X/FWCore/Skeletons/scripts/mkTemplates/ESProducer/ESProducer.cc |
||
|
||
switch(cpeNum_) { | ||
|
||
case TRIVIAL: | ||
cpe_ = boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> >(new Phase2StripCPETrivial()); | ||
break; | ||
|
||
} | ||
|
||
return cpe_; | ||
} | ||
|
||
|
||
#include "FWCore/Framework/interface/ModuleFactory.h" | ||
DEFINE_FWK_EVENTSETUP_MODULE(Phase2StripCPEESProducer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose .first for the z (localy) direction and .second for x are not confusing.
Also, is it meaningful to define the second dimension for the barycenter of a 1D type .. and also to convert it to a float already here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are 1D clusters built in a 2D plane, so the second coordinate actually makes sense. We do 1D because that's what the electronics does.