17 #include "boost/foreach.hpp"
20 : clusters_token_( consumes< edmNew::DetSetVector<
SiStripCluster> >(iConfig.getParameter<edm::
InputTag>(
"Clusters"))),
22 runningmode_( iConfig.getParameter<std::
string>(
"runningMode") )
24 std::vector<edm::InputTag> simhits_tags = iConfig.
getParameter<std::vector<edm::InputTag> >(
"InputTags");
25 for(
auto itag : simhits_tags) {
27 consumes< std::vector<PSimHit> >(itag)
31 produces <std::vector<unsigned> > (
Prefix +
"hits" );
32 produces <std::vector<float> > (
Prefix +
"strip" );
33 produces <std::vector<float> > (
Prefix +
"localtheta" );
34 produces <std::vector<float> > (
Prefix +
"localphi" );
35 produces <std::vector<float> > (
Prefix +
"localx" );
36 produces <std::vector<float> > (
Prefix +
"localy" );
37 produces <std::vector<float> > (
Prefix +
"localz" );
38 produces <std::vector<float> > (
Prefix +
"momentum" );
39 produces <std::vector<float> > (
Prefix +
"energyloss" );
40 produces <std::vector<float> > (
Prefix +
"time" );
41 produces <std::vector<int> > (
Prefix +
"particle" );
42 produces <std::vector<unsigned short> > (
Prefix +
"process" );
49 int size = clustermap.size();
50 std::auto_ptr<std::vector<unsigned> > hits (
new std::vector<unsigned> (size, 0) );
51 std::auto_ptr<std::vector<float> > strip (
new std::vector<float> (size, -100) );
52 std::auto_ptr<std::vector<float> > localtheta (
new std::vector<float> (size, -100) );
53 std::auto_ptr<std::vector<float> > localphi (
new std::vector<float> (size, -100) );
54 std::auto_ptr<std::vector<float> > localx (
new std::vector<float> (size, -100) );
55 std::auto_ptr<std::vector<float> > localy (
new std::vector<float> (size, -100) );
56 std::auto_ptr<std::vector<float> > localz (
new std::vector<float> (size, -100) );
57 std::auto_ptr<std::vector<float> > momentum (
new std::vector<float> (size, 0) );
58 std::auto_ptr<std::vector<float> > energyloss (
new std::vector<float> (size, -1) );
59 std::auto_ptr<std::vector<float> > time (
new std::vector<float> (size, -1) );
60 std::auto_ptr<std::vector<int> > particle (
new std::vector<int> (size,-500) );
61 std::auto_ptr<std::vector<unsigned short> >
process (
new std::vector<unsigned short> (size,0) );
80 shallow::CLUSTERMAP::const_iterator cluster =
match_cluster(
id, driftedstrip_, clustermap, *clusters);
81 if(cluster != clustermap.end()) {
82 unsigned i = cluster->second;
84 if(hits->at(i) == 1) {
85 strip->at(i) = hitstrip_;
91 momentum->at(i) = hit.
pabs();
103 iEvent.
put( localtheta,
Prefix +
"localtheta" );
104 iEvent.
put( localphi,
Prefix +
"localphi" );
108 iEvent.
put( momentum,
Prefix +
"momentum" );
109 iEvent.
put( energyloss,
Prefix +
"energyloss" );
111 iEvent.
put( particle,
Prefix +
"particle" );
112 iEvent.
put( process,
Prefix +
"process" );
117 shallow::CLUSTERMAP::const_iterator cluster = clustermap.end();
119 if( clustersDetSet != clusters.
end() ) {
121 while( right != clustersDetSet->
end() && strip_ > right->barycenter() )
124 if(right!=clustersDetSet->
end() && right!=clustersDetSet->
begin()) {
125 unsigned firstStrip = (right->barycenter()-strip_) < (strip_-left->barycenter()) ? right->firstStrip() : left->firstStrip();
126 cluster = clustermap.find( std::make_pair(
id, firstStrip));
128 else if(right != clustersDetSet->
begin())
129 cluster = clustermap.find( std::make_pair(
id, left->firstStrip()));
131 cluster = clustermap.find( std::make_pair(
id, right->firstStrip()));
T getParameter(std::string const &) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
tuple SiStripLorentzAngle
shallow::CLUSTERMAP::const_iterator match_cluster(const unsigned &, const float &, const shallow::CLUSTERMAP &, const edmNew::DetSetVector< SiStripCluster > &) const
Geom::Theta< float > thetaAtEntry() const
fast and more accurate access to momentumAtEntry().theta()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
data_type const * const_iterator
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
virtual float strip(const LocalPoint &) const =0
float timeOfFlight() const
Local3DPoint localPosition() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ShallowSimhitClustersProducer(const edm::ParameterSet &)
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned short processType() const
const_iterator find(id_type i, bool update=false) const
CLUSTERMAP make_cluster_map(const edm::Event &, const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > &)
float energyLoss() const
The energy deposit in the PSimHit, in ???.
void produce(edm::Event &, const edm::EventSetup &)
std::map< std::pair< uint32_t, uint16_t >, unsigned int > CLUSTERMAP
Geom::Phi< float > phiAtEntry() const
fast and more accurate access to momentumAtEntry().phi()
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simhits_tokens_
tuple size
Write out results.
const_iterator begin(bool update=false) const
unsigned int detUnitId() const