Skip to content

Commit

Permalink
New 2D pixel template reconstruction, with "cluster repair" capability.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaksim1 committed Mar 3, 2018
1 parent e4b8a67 commit 3ecf9e6
Show file tree
Hide file tree
Showing 16 changed files with 1,777 additions and 887 deletions.
3 changes: 2 additions & 1 deletion RecoLocalTracker/Records/interface/TkPixelCPERecord.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
//#include "CondFormats/DataRecord/interface/SiPixelCPEGenericErrorParmRcd.h"
#include "CondFormats/DataRecord/interface/SiPixelGenErrorDBObjectRcd.h"
#include "CalibTracker/Records/interface/SiPixelTemplateDBObjectESProducerRcd.h"
#include "CalibTracker/Records/interface/SiPixel2DTemplateDBObjectESProducerRcd.h"

#include "boost/mpl/vector.hpp"

class TkPixelCPERecord: public edm::eventsetup::DependentRecordImplementation<TkPixelCPERecord,
boost::mpl::vector<TrackerDigiGeometryRecord,IdealMagneticFieldRecord,SiPixelLorentzAngleRcd,SiPixelGenErrorDBObjectRcd,SiPixelTemplateDBObjectESProducerRcd> > {};
boost::mpl::vector<TrackerDigiGeometryRecord,IdealMagneticFieldRecord,SiPixelLorentzAngleRcd,SiPixelGenErrorDBObjectRcd,SiPixelTemplateDBObjectESProducerRcd,SiPixel2DTemplateDBObjectESProducerRcd> > {};

#endif

3 changes: 3 additions & 0 deletions RecoLocalTracker/SiPixelRecHits/interface/PixelCPEBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class PixelCPEBase : public PixelClusterParameterEstimator
// [email protected] (10/18/2008)
bool with_track_angle; // filled in computeAnglesFrom....

// More detailed edge information (for CPE ClusterRepair, and elsewhere...)
int edgeTypeX_ = 0; // 0: not on edge, 1: low end on edge, 2: high end
int edgeTypeY_ = 0; // 0: not on edge, 1: low end on edge, 2: high end
};

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class PixelCPEGenericESProducer: public edm::ESProducer{
public:
PixelCPEGenericESProducer(const edm::ParameterSet & p);
~PixelCPEGenericESProducer() override;
std::unique_ptr<PixelClusterParameterEstimator> produce(const TkPixelCPERecord &);
std::shared_ptr<PixelClusterParameterEstimator> produce(const TkPixelCPERecord &);
private:
std::shared_ptr<PixelClusterParameterEstimator> cpe_;
edm::ParameterSet pset_;
edm::ESInputTag magname_;
bool useLAWidthFromDB_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ class PixelCPETemplateReco : public PixelCPEBase
int speed_ ;

bool UseClusterSplitter_;

// Template file management (when not getting the templates from the DB)
int barrelTemplateID_ ;
int forwardTemplateID_ ;
std::string templateDir_ ;

//bool DoCosmics_;
//bool LoadTemplatesFromDB_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class PixelCPETemplateRecoESProducer: public edm::ESProducer{
public:
PixelCPETemplateRecoESProducer(const edm::ParameterSet & p);
~PixelCPETemplateRecoESProducer() override;
std::unique_ptr<PixelClusterParameterEstimator> produce(const TkPixelCPERecord &);
std::shared_ptr<PixelClusterParameterEstimator> produce(const TkPixelCPERecord &);
private:
std::shared_ptr<PixelClusterParameterEstimator> cpe_;
edm::ParameterSet pset_;
bool DoLorentz_;
};
Expand Down
29 changes: 25 additions & 4 deletions RecoLocalTracker/SiPixelRecHits/interface/SiPixelGenError.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
//
// SiPixelGenError.h (v2.00)
// SiPixelGenError.h (v2.20)
//
// Object to contain Lorentz drift and error information for the Generic Algorithm
//
// Created by Morris Swartz on 1/10/2014.
//
// Update for Phase 1 FPix, M.S. 1/15/17
// V2.01 - Allow subdetector ID=5 for FPix R2P2, Fix error message
// V2.10 - Update the variable size [SI_PIXEL_TEMPLATE_USE_BOOST] option so that it works with VI's enhancements
// V2.20 - Add directory path selection to the ascii pushfile method



//

// Build the template storage structure from several pieces
Expand All @@ -16,6 +22,7 @@

#include<vector>
#include<cassert>
#include "boost/multi_array.hpp"

#ifndef SI_PIXEL_TEMPLATE_STANDALONE
#include "CondFormats/SiPixelObjects/interface/SiPixelGenErrorDBObject.h"
Expand Down Expand Up @@ -77,11 +84,19 @@ struct SiPixelGenErrorHeader { //!< template header structure

struct SiPixelGenErrorStore { //!< template storage structure
SiPixelGenErrorHeader head;
#ifndef SI_PIXEL_TEMPLATE_USE_BOOST
float cotbetaY[60];
float cotbetaX[5];
float cotalphaX[29];
SiPixelGenErrorEntry enty[60]; //!< 60 Barrel y templates spanning cluster lengths from 0px to +18px [28 entries for fpix]
SiPixelGenErrorEntry entx[5][29]; //!< 29 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 5 slices [3x29 for fpix]
#else
float* cotbetaY;
float* cotbetaX;
float* cotalphaX;
boost::multi_array<SiPixelGenErrorEntry,1> enty; //!< use 1d entry to store [60] barrel entries or [28] fpix entries
boost::multi_array<SiPixelGenErrorEntry,2> entx; //!< use 2d entry to store [5][29] barrel entries or [3][29] fpix entries
#endif
} ;


Expand All @@ -104,9 +119,10 @@ class SiPixelGenError {
public:
SiPixelGenError(const std::vector< SiPixelGenErrorStore > & thePixelTemp) : thePixelTemp_(thePixelTemp) { id_current_ = -1; index_id_ = -1;} //!< Constructor for cases in which template store already exists

static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > & thePixelTemp_); // load the private store with info from the
// file with the index (int) filenum

// Load the private store with info from the file with the index (int) filenum from directory dir:
// ${dir}generror_summary_zp${filenum}.out
static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > & thePixelTemp_ , std::string dir = "");

#ifndef SI_PIXEL_TEMPLATE_STANDALONE
static bool pushfile(const SiPixelGenErrorDBObject& dbobject, std::vector< SiPixelGenErrorStore > & thePixelTemp_); // load the private store with info from db
#endif
Expand All @@ -119,6 +135,11 @@ class SiPixelGenError {
int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, bool irradiationCorrections,
int& pixmx, float& sigmay, float& deltay, float& sigmax, float& deltax,
float& sy1, float& dy1, float& sy2, float& dy2, float& sx1, float& dx1, float& sx2, float& dx2);

// Overload to provide backward compatibility

int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, float& pixmx, float& sigmay, float& deltay, float& sigmax, float& deltax,
float& sy1, float& dy1, float& sy2, float& dy2, float& sx1, float& dx1, float& sx2, float& dx2);
// Overloaded method to provide only the LA parameters
int qbin(int id);

Expand Down
17 changes: 11 additions & 6 deletions RecoLocalTracker/SiPixelRecHits/interface/SiPixelTemplate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// SiPixelTemplate.h (v10.13)
// SiPixelTemplate.h (v10.20)
//
// Add goodness-of-fit info and spare entries to templates, version number in template header, more error checking
// Add correction for (Q_F-Q_L)/(Q_F+Q_L) bias
Expand Down Expand Up @@ -76,6 +76,8 @@
// V10.11 - Allow subdetector ID=5 for FPix R2P2 [allows better internal labeling of templates]
// V10.12 - Enforce minimum signal size in pixel charge uncertainty calculation
// V10.13 - Update the variable size [SI_PIXEL_TEMPLATE_USE_BOOST] option so that it works with VI's enhancements
// V10.20 - Add directory path selection to the ascii pushfile method




Expand Down Expand Up @@ -217,9 +219,9 @@ struct SiPixelTemplateStore { //!< template storage structure
SiPixelTemplateEntry entx[5][29]; //!< 29 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 5 slices [3x29 for fpix]
void destroy() {};
#else
float* cotbetaY=nullptr;
float* cotbetaX=nullptr;
float* cotalphaX=nullptr;
float* cotbetaY;
float* cotbetaX;
float* cotalphaX;
boost::multi_array<SiPixelTemplateEntry,1> enty; //!< use 1d entry to store [60] barrel entries or [28] fpix entries
boost::multi_array<SiPixelTemplateEntry,2> entx; //!< use 2d entry to store [5][29] barrel entries or [3][29] fpix entries
void destroy() { // deletes arrays created by pushfile method of SiPixelTemplate
Expand Down Expand Up @@ -254,8 +256,11 @@ class SiPixelTemplate {
public:
SiPixelTemplate(const std::vector< SiPixelTemplateStore > & thePixelTemp) : thePixelTemp_(thePixelTemp) { id_current_ = -1; index_id_ = -1; cota_current_ = 0.; cotb_current_ = 0.; } //!< Constructor for cases in which template store already exists

static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > & thePixelTemp_); // load the private store with info from the
// file with the index (int) filenum

// Load the private store with info from the file with the index (int) filenum from directory dir:
// ${dir}template_summary_zp${filenum}.out
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > & thePixelTemp_ , std::string dir = "");


#ifndef SI_PIXEL_TEMPLATE_STANDALONE
static bool pushfile(const SiPixelTemplateDBObject& dbobject, std::vector< SiPixelTemplateStore > & thePixelTemp_); // load the private store with info from db
Expand Down
Loading

0 comments on commit 3ecf9e6

Please sign in to comment.