-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
496 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* | ||
* This is a part of CTPPS offline software. | ||
* Author: | ||
* Fabrizio Ferro (ferro@ge.infn.it) | ||
* | ||
*/ | ||
|
||
#ifndef DataFormats_CTPPSReco_CTPPSPixelRecHit_H | ||
#define DataFormats_CTPPSReco_CTPPSPixelRecHit_H | ||
|
||
|
||
#include "DataFormats/GeometrySurface/interface/LocalError.h" | ||
#include "DataFormats/GeometryVector/interface/LocalPoint.h" | ||
|
||
// Reconstructed hits in CTPPS Pixel detector | ||
|
||
class CTPPSPixelRecHit{ | ||
|
||
public: | ||
|
||
CTPPSPixelRecHit(){} | ||
CTPPSPixelRecHit(LocalPoint lp, LocalError le) : thePoint(lp), theError(le), isOnEdge_(false),hasBadPixels_(false), spanTwoRocs_(false), minPixelRow_(0), minPixelCol_(0), clusterSize_(0), clusterSizeRow_(0), clusterSizeCol_(0){} | ||
CTPPSPixelRecHit(LocalPoint lp, LocalError le, bool edge, bool bad, bool rocs) : thePoint(lp), theError(le), isOnEdge_(edge),hasBadPixels_(bad), spanTwoRocs_(rocs), minPixelRow_(0), minPixelCol_(0), clusterSize_(0), clusterSizeRow_(0), clusterSizeCol_(0){} | ||
CTPPSPixelRecHit(LocalPoint lp, LocalError le, bool edge, bool bad, bool rocs, int minrow, int mincol, int size, int rowsize, int colsize) : thePoint(lp), theError(le), isOnEdge_(edge),hasBadPixels_(bad), spanTwoRocs_(rocs), minPixelRow_(minrow), minPixelCol_(mincol), clusterSize_(size), clusterSizeRow_(rowsize), clusterSizeCol_(colsize){} | ||
|
||
|
||
inline LocalPoint getPoint() const { return thePoint;} | ||
inline LocalError getError() const { return theError;} | ||
|
||
inline bool isOnEdge() const {return isOnEdge_;} | ||
inline bool hasBadPixels() const {return hasBadPixels_;} | ||
inline bool spanTwoRocs() const {return spanTwoRocs_;} | ||
|
||
|
||
inline unsigned int minPixelRow() const { return minPixelRow_;} | ||
inline unsigned int minPixelCol() const { return minPixelCol_;} | ||
|
||
inline unsigned int clusterSize() const { return clusterSize_;} | ||
inline unsigned int clusterSizeRow() const { return clusterSizeRow_;} | ||
inline unsigned int clusterSizeCol() const { return clusterSizeCol_;} | ||
|
||
private: | ||
|
||
LocalPoint thePoint; | ||
LocalError theError; | ||
|
||
bool isOnEdge_; | ||
bool hasBadPixels_; | ||
bool spanTwoRocs_; | ||
|
||
unsigned int minPixelRow_; | ||
unsigned int minPixelCol_; | ||
|
||
unsigned int clusterSize_; | ||
unsigned int clusterSizeRow_; | ||
unsigned int clusterSizeCol_; | ||
|
||
}; | ||
|
||
inline bool operator< (CTPPSPixelRecHit& a, CTPPSPixelRecHit& b) | ||
{ | ||
|
||
return (a.getPoint().mag() < b.getPoint().mag()); | ||
|
||
}; | ||
|
||
#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
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
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,53 @@ | ||
/********************************************************************** | ||
* | ||
* Author: F.Ferro - INFN Genova | ||
* | ||
**********************************************************************/ | ||
#ifndef RecoCTPPS_PixelLocal_CTPPSPixelRecHitProducer_H | ||
#define RecoCTPPS_PixelLocal_CTPPSPixelRecHitProducer_H | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
#include "DataFormats/Common/interface/DetSet.h" | ||
|
||
#include "FWCore/Framework/interface/stream/EDProducer.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "DataFormats/Common/interface/Handle.h" | ||
#include "FWCore/Framework/interface/ESHandle.h" | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Utilities/interface/InputTag.h" | ||
|
||
#include "DataFormats/CTPPSReco/interface/CTPPSPixelCluster.h" | ||
#include "DataFormats/CTPPSReco/interface/CTPPSPixelRecHit.h" | ||
#include "DataFormats/DetId/interface/DetId.h" | ||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
#include "DataFormats/CTPPSDetId/interface/CTPPSPixelDetId.h" | ||
#include "RecoCTPPS/PixelLocal/interface/RPixClusterToHit.h" | ||
|
||
|
||
class CTPPSPixelRecHitProducer : public edm::stream::EDProducer<> | ||
{ | ||
public: | ||
explicit CTPPSPixelRecHitProducer(const edm::ParameterSet& param); | ||
|
||
~CTPPSPixelRecHitProducer(); | ||
|
||
virtual void produce(edm::Event&, const edm::EventSetup&) override; | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions & descriptions); | ||
|
||
private: | ||
edm::ParameterSet param_; | ||
int verbosity_; | ||
|
||
edm::InputTag src_; | ||
edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelCluster>> tokenCTPPSPixelCluster_; | ||
|
||
RPixClusterToHit cluster2hit_; | ||
|
||
void run(const edm::DetSetVector<CTPPSPixelCluster> &input, edm::DetSetVector<CTPPSPixelRecHit> &output); | ||
}; | ||
|
||
#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,32 @@ | ||
/********************************************************************** | ||
* | ||
* Author: F.Ferro - INFN Genova | ||
* | ||
**********************************************************************/ | ||
#ifndef RecoCTPPS_PixelLocal_RPixClusterToHit_H | ||
#define RecoCTPPS_PixelLocal_RPixClusterToHit_H | ||
|
||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "DataFormats/Common/interface/DetSetVector.h" | ||
#include "DataFormats/CTPPSReco/interface/CTPPSPixelCluster.h" | ||
#include "DataFormats/CTPPSReco/interface/CTPPSPixelRecHit.h" | ||
#include "Geometry/VeryForwardGeometry/interface/CTPPSPixelSimTopology.h" | ||
|
||
class RPixClusterToHit{ | ||
|
||
public: | ||
|
||
RPixClusterToHit(edm::ParameterSet const& conf); | ||
|
||
void buildHits(unsigned int detId, const std::vector<CTPPSPixelCluster> &clusters, std::vector<CTPPSPixelRecHit> &hits); | ||
void make_hit(CTPPSPixelCluster aCluster, std::vector<CTPPSPixelRecHit> &hits ); | ||
~RPixClusterToHit(); | ||
|
||
private: | ||
|
||
const edm::ParameterSet ¶ms_; | ||
int verbosity_; | ||
|
||
}; | ||
|
||
#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,49 @@ | ||
#include "RecoCTPPS/PixelLocal/interface/CTPPSPixelRecHitProducer.h" | ||
|
||
|
||
CTPPSPixelRecHitProducer::CTPPSPixelRecHitProducer(const edm::ParameterSet& conf) : | ||
param_(conf), cluster2hit_(conf) | ||
{ | ||
src_ = conf.getParameter<std::string>("label"); | ||
verbosity_ = conf.getUntrackedParameter<int> ("RPixVerbosity"); | ||
tokenCTPPSPixelCluster_ = consumes<edm::DetSetVector<CTPPSPixelCluster> >(edm::InputTag(src_)); | ||
produces<edm::DetSetVector<CTPPSPixelRecHit> > (); | ||
} | ||
|
||
CTPPSPixelRecHitProducer::~CTPPSPixelRecHitProducer() {} | ||
|
||
void CTPPSPixelRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions & descriptions){ | ||
edm::ParameterSetDescription desc; | ||
desc.addUntracked<int>("RPixVerbosity",0); | ||
desc.add<std::string>("label", "ctppsPixelClusters"); | ||
descriptions.add("ctppsPixelRecHits", desc); | ||
} | ||
|
||
void CTPPSPixelRecHitProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||
|
||
edm::Handle<edm::DetSetVector<CTPPSPixelCluster> > rpCl; | ||
iEvent.getByToken(tokenCTPPSPixelCluster_, rpCl); | ||
|
||
edm::DetSetVector<CTPPSPixelRecHit> output; | ||
|
||
// run reconstruction | ||
if (rpCl->size()) | ||
run(*rpCl, output); | ||
|
||
iEvent.put(std::make_unique<edm::DetSetVector<CTPPSPixelRecHit> >(output)); | ||
|
||
} | ||
|
||
void CTPPSPixelRecHitProducer::run(const edm::DetSetVector<CTPPSPixelCluster> &input, edm::DetSetVector<CTPPSPixelRecHit> &output){ | ||
|
||
for (const auto &ds_cluster : input) | ||
{ | ||
edm::DetSet<CTPPSPixelRecHit> &ds_rechit = output.find_or_insert(ds_cluster.id); | ||
|
||
//calculate the cluster parameters and convert it into a rechit | ||
cluster2hit_.buildHits(ds_cluster.id, ds_cluster.data, ds_rechit.data); | ||
|
||
} | ||
} | ||
|
||
DEFINE_FWK_MODULE( CTPPSPixelRecHitProducer); |
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
Oops, something went wrong.