CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
SiPixelDigitizerAlgorithm Class Reference

#include <SiPixelDigitizerAlgorithm.h>

Classes

class  Amplitude
 
class  CalParameters
 
class  EnergyDepositUnit
 
struct  PixelAging
 
struct  PixelEfficiencies
 
class  SignalPoint
 

Public Types

typedef std::unordered_map< std::string, PixelFEDChannelCollectionPixelFEDChannelCollectionMap
 

Public Member Functions

void accumulateSimHits (const std::vector< PSimHit >::const_iterator inputBegin, const std::vector< PSimHit >::const_iterator inputEnd, const size_t inputBeginGlobalIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
 
void calculateInstlumiFactor (PileupMixingContent *puInfo)
 
void calculateInstlumiFactor (const std::vector< PileupSummaryInfo > &ps, int bunchSpacing)
 
std::unique_ptr< PixelFEDChannelCollectionchooseScenario (PileupMixingContent *puInfo, CLHEP::HepRandomEngine *)
 
std::unique_ptr< PixelFEDChannelCollectionchooseScenario (const std::vector< PileupSummaryInfo > &ps, CLHEP::HepRandomEngine *engine)
 
void digitize (const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
 
void init (const edm::EventSetup &es)
 
void init_DynIneffDB (const edm::EventSetup &, const unsigned int &)
 
void initializeEvent ()
 
bool killBadFEDChannels () const
 
void setSimAccumulator (const std::map< uint32_t, std::map< int, int > > &signalMap)
 
 SiPixelDigitizerAlgorithm (const edm::ParameterSet &conf)
 
 ~SiPixelDigitizerAlgorithm ()
 

Public Attributes

const PixelFEDChannelCollectionMapquality_map
 

Private Types

typedef boost::multi_array< float, 2 > array_2d
 
typedef GloballyPositioned< double > Frame
 
typedef std::vector< edm::ParameterSetParameters
 
typedef signal_map_type::const_iterator signal_map_const_iterator
 
typedef signal_map_type::iterator signal_map_iterator
 
typedef std::map< int, Amplitude, std::less< int > > signal_map_type
 
typedef std::map< uint32_t, signal_map_typesignalMaps
 

Private Member Functions

void add_noise (const PixelGeomDetUnit *pixdet, float thePixelThreshold, CLHEP::HepRandomEngine *)
 
double calcQ (float x) const
 
void drift (const PSimHit &hit, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, const std::vector< EnergyDepositUnit > &ionization_points, std::vector< SignalPoint > &collection_points) const
 
LocalVector DriftDirection (const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
 
void fluctuateEloss (int particleId, float momentum, float eloss, float length, int NumberOfSegments, float elossVector[], CLHEP::HepRandomEngine *) const
 
bool hitSignalReweight (const PSimHit &hit, std::map< int, float, std::less< int > > &hit_signal, const size_t hitIndex, const unsigned int tofBin, const PixelTopology *topol, uint32_t detID, signal_map_type &theSignal, unsigned short int processType)
 
void induce_signal (std::vector< PSimHit >::const_iterator inputBegin, std::vector< PSimHit >::const_iterator inputEnd, const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const std::vector< SignalPoint > &collection_points)
 
std::map< int, CalParameters, std::less< int > > initCal () const
 
void make_digis (float thePixelThresholdInE, uint32_t detID, const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo) const
 
float missCalibrate (uint32_t detID, const TrackerTopology *tTopo, const PixelGeomDetUnit *pixdet, int col, int row, float amp) const
 
void module_killing_conf (uint32_t detID)
 
void module_killing_DB (uint32_t detID)
 
float pixel_aging (const PixelAging &aging, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo) const
 
void pixel_inefficiency (const PixelEfficiencies &eff, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
 
void pixel_inefficiency_db (uint32_t detID)
 
int PixelTempRewgt2D (int id_gen, int id_rewgt, array_2d &cluster)
 
void primary_ionization (const PSimHit &hit, std::vector< EnergyDepositUnit > &ionization_points, CLHEP::HepRandomEngine *) const
 
void printCluster (array_2d &cluster)
 
void printCluster (float arr[13+2][21+2])
 
void printCluster (float arr[13][21])
 

Private Attributes

signalMaps _signal
 
const bool addChargeVCALSmearing
 
const bool addNoise
 
const bool addNoisyPixels
 
const bool AddPixelAging
 
const bool AddPixelInefficiency
 
const bool addThresholdSmearing
 
const bool alpha2Order
 
const float BPix_p0
 
const float BPix_p1
 
const float BPix_p2
 
const float BPix_p3
 
const std::map< int, CalParameters, std::less< int > > calmap
 
const float ClusterWidth
 
const SiPixel2DTemplateDBObjectdbobject_den
 
const SiPixel2DTemplateDBObjectdbobject_num
 
const Parameters DeadModules
 
const float Dist300
 
const bool doMissCalibrate
 
const float electronsPerVCAL
 
const float electronsPerVCAL_L1
 
const float electronsPerVCAL_L1_Offset
 
const float electronsPerVCAL_Offset
 
const std::unique_ptr< SiG4UniversalFluctuationfluctuate
 
const bool fluctuateCharge
 
const float FPix_p0
 
const float FPix_p1
 
const float FPix_p2
 
const float FPix_p3
 
edm::ESHandle< TrackerGeometrygeom_
 
const float GeVperElectron
 
int IDden
 
int IDnum
 
const bool KillBadFEDChannels
 
const bool makeDigiSimLinks_
 
edm::ESHandle< SiPixelFedCablingMapmap_
 
const int NumberOfBarrelLayers
 
const int NumberOfEndcapDisks
 
const PixelAging pixelAging_
 
PixelEfficiencies pixelEfficiencies_
 
edm::ESHandle< PixelFEDChannelCollectionMapPixelFEDChannelCollectionMapHandle
 
const bool PrintClusters
 
const bool PrintTemplates
 
edm::ESHandle< SiPixelQualityProbabilitiesscenarioProbabilityHandle
 
const float Sigma0
 
edm::ESHandle< SiPixelQualitySiPixelBadModule_
 
edm::ESHandle< SiPixelDynamicInefficiencySiPixelDynamicInefficiency_
 
edm::ESHandle< SiPixelLorentzAngleSiPixelLorentzAngle_
 
std::string siPixelQualityLabel
 
const float tanLorentzAnglePerTesla_BPix
 
const float tanLorentzAnglePerTesla_FPix
 
SiPixelTemplate2D templ2D
 
std::vector< SiPixelTemplateStore2DtemplateStores_
 
const int theAdcFullScale
 
const float theElectronPerADC
 
const float theGainSmearing
 
const float theNoiseInElectrons
 
const std::unique_ptr< GaussianTailNoiseGeneratortheNoiser
 
const float theOffsetSmearing
 
const float theReadoutNoise
 
const std::unique_ptr< SiPixelGainCalibrationOfflineSimServicetheSiPixelGainCalibrationService_
 
const float theThresholdInE_BPix
 
const float theThresholdInE_BPix_L1
 
const float theThresholdInE_BPix_L2
 
const float theThresholdInE_FPix
 
const double theThresholdSmearing_BPix
 
const double theThresholdSmearing_BPix_L1
 
const double theThresholdSmearing_BPix_L2
 
const double theThresholdSmearing_FPix
 
const float theTofLowerCut
 
const float theTofUpperCut
 
const double tMax
 
std::vector< float > track
 
const bool use_deadmodule_DB_
 
const bool use_ineff_from_db_
 
const bool use_LorentzAngle_DB_
 
const bool use_module_killing_
 
const bool UseReweighting
 
std::vector< bool > xdouble
 
std::vector< bool > ydouble
 

Detailed Description

Definition at line 54 of file SiPixelDigitizerAlgorithm.h.

Member Typedef Documentation

typedef boost::multi_array<float, 2> SiPixelDigitizerAlgorithm::array_2d
private

Definition at line 300 of file SiPixelDigitizerAlgorithm.h.

Definition at line 298 of file SiPixelDigitizerAlgorithm.h.

Definition at line 299 of file SiPixelDigitizerAlgorithm.h.

Definition at line 90 of file SiPixelDigitizerAlgorithm.h.

typedef signal_map_type::const_iterator SiPixelDigitizerAlgorithm::signal_map_const_iterator
private

Definition at line 296 of file SiPixelDigitizerAlgorithm.h.

typedef signal_map_type::iterator SiPixelDigitizerAlgorithm::signal_map_iterator
private

Definition at line 295 of file SiPixelDigitizerAlgorithm.h.

typedef std::map<int, Amplitude, std::less<int> > SiPixelDigitizerAlgorithm::signal_map_type
private

Definition at line 294 of file SiPixelDigitizerAlgorithm.h.

typedef std::map<uint32_t, signal_map_type> SiPixelDigitizerAlgorithm::signalMaps
private

Definition at line 297 of file SiPixelDigitizerAlgorithm.h.

Constructor & Destructor Documentation

SiPixelDigitizerAlgorithm::SiPixelDigitizerAlgorithm ( const edm::ParameterSet conf)

Definition at line 198 of file SiPixelDigitizerAlgorithm.cc.

References AddPixelInefficiency, theAdcFullScale, theElectronPerADC, theThresholdInE_BPix, theThresholdInE_BPix_L1, theThresholdInE_BPix_L2, theThresholdInE_FPix, and tMax.

199  :
200 
202  conf.getParameter<std::string>("SiPixelQualityLabel")), //string to specify SiPixelQuality label
203  _signal(),
204  makeDigiSimLinks_(conf.getUntrackedParameter<bool>("makeDigiSimLinks", true)),
205  use_ineff_from_db_(conf.getParameter<bool>("useDB")),
206  use_module_killing_(conf.getParameter<bool>("killModules")), // boolean to kill or not modules
207  use_deadmodule_DB_(conf.getParameter<bool>("DeadModules_DB")), // boolean to access dead modules from DB
208  use_LorentzAngle_DB_(conf.getParameter<bool>("LorentzAngle_DB")), // boolean to access Lorentz angle from DB
209 
211  : conf.getParameter<Parameters>("DeadModules")), // get dead module from cfg file
212 
214  xdouble(TXSIZE),
215  ydouble(TYSIZE),
216  IDnum(conf.exists("TemplateIDnumerator") ? conf.getParameter<int>("TemplateIDnumerator") : 0),
217  IDden(conf.exists("TemplateIDdenominator") ? conf.getParameter<int>("TemplateIDdenominator") : 0),
218 
219  // Common pixel parameters
220  // These are parameters which are not likely to be changed
221  GeVperElectron(3.61E-09), // 1 electron(3.61eV, 1keV(277e, mod 9/06 d.k.
222  Sigma0(0.00037), // Charge diffusion constant 7->3.7
223  Dist300(0.0300), // normalized to 300micron Silicon
224  alpha2Order(conf.getParameter<bool>("Alpha2Order")), // switch on/off of E.B effect
225  ClusterWidth(3.), // Charge integration spread on the collection plane
226 
227  // get external parameters:
228  // To account for upgrade geometries do not assume the number
229  // of layers or disks.
230  NumberOfBarrelLayers(conf.exists("NumPixelBarrel") ? conf.getParameter<int>("NumPixelBarrel") : 3),
231  NumberOfEndcapDisks(conf.exists("NumPixelEndcap") ? conf.getParameter<int>("NumPixelEndcap") : 2),
232 
233  // ADC calibration 1adc count(135e.
234  // Corresponds to 2adc/kev, 270[e/kev]/135[e/adc](2[adc/kev]
235  // Be carefull, this parameter is also used in SiPixelDet.cc to
236  // calculate the noise in adc counts from noise in electrons.
237  // Both defaults should be the same.
238  theElectronPerADC(conf.getParameter<double>("ElectronPerAdc")),
239 
240  // ADC saturation value, 255(8bit adc.
241  //theAdcFullScale(conf.getUntrackedParameter<int>("AdcFullScale",255)),
242  theAdcFullScale(conf.getParameter<int>("AdcFullScale")),
243 
244  // Noise in electrons:
245  // Pixel cell noise, relevant for generating noisy pixels
246  theNoiseInElectrons(conf.getParameter<double>("NoiseInElectrons")),
247 
248  // Fill readout noise, including all readout chain, relevant for smearing
249  //theReadoutNoise(conf.getUntrackedParameter<double>("ReadoutNoiseInElec",500.)),
250  theReadoutNoise(conf.getParameter<double>("ReadoutNoiseInElec")),
251 
252  // Pixel threshold in units of noise:
253  // thePixelThreshold(conf.getParameter<double>("ThresholdInNoiseUnits")),
254  // Pixel threshold in electron units.
255  theThresholdInE_FPix(conf.getParameter<double>("ThresholdInElectrons_FPix")),
256  theThresholdInE_BPix(conf.getParameter<double>("ThresholdInElectrons_BPix")),
257  theThresholdInE_BPix_L1(conf.exists("ThresholdInElectrons_BPix_L1")
258  ? conf.getParameter<double>("ThresholdInElectrons_BPix_L1")
260  theThresholdInE_BPix_L2(conf.exists("ThresholdInElectrons_BPix_L2")
261  ? conf.getParameter<double>("ThresholdInElectrons_BPix_L2")
263 
264  // Add threshold gaussian smearing:
265  theThresholdSmearing_FPix(conf.getParameter<double>("ThresholdSmearing_FPix")),
266  theThresholdSmearing_BPix(conf.getParameter<double>("ThresholdSmearing_BPix")),
267  theThresholdSmearing_BPix_L1(conf.exists("ThresholdSmearing_BPix_L1")
268  ? conf.getParameter<double>("ThresholdSmearing_BPix_L1")
270  theThresholdSmearing_BPix_L2(conf.exists("ThresholdSmearing_BPix_L2")
271  ? conf.getParameter<double>("ThresholdSmearing_BPix_L2")
273 
274  // electrons to VCAL conversion needed in misscalibrate()
275  electronsPerVCAL(conf.getParameter<double>("ElectronsPerVcal")),
276  electronsPerVCAL_Offset(conf.getParameter<double>("ElectronsPerVcal_Offset")),
277  electronsPerVCAL_L1(conf.exists("ElectronsPerVcal_L1") ? conf.getParameter<double>("ElectronsPerVcal_L1")
278  : electronsPerVCAL),
279  electronsPerVCAL_L1_Offset(conf.exists("ElectronsPerVcal_L1_Offset")
280  ? conf.getParameter<double>("ElectronsPerVcal_L1_Offset")
282 
283  //theTofCut 12.5, cut in particle TOD +/- 12.5ns
284  //theTofCut(conf.getUntrackedParameter<double>("TofCut",12.5)),
285  theTofLowerCut(conf.getParameter<double>("TofLowerCut")),
286  theTofUpperCut(conf.getParameter<double>("TofUpperCut")),
287 
288  // Get the Lorentz angle from the cfg file:
290  : conf.getParameter<double>("TanLorentzAnglePerTesla_FPix")),
292  : conf.getParameter<double>("TanLorentzAnglePerTesla_BPix")),
293 
294  // signal response new parameterization: split Fpix and BPix
295  FPix_p0(conf.getParameter<double>("FPix_SignalResponse_p0")),
296  FPix_p1(conf.getParameter<double>("FPix_SignalResponse_p1")),
297  FPix_p2(conf.getParameter<double>("FPix_SignalResponse_p2")),
298  FPix_p3(conf.getParameter<double>("FPix_SignalResponse_p3")),
299 
300  BPix_p0(conf.getParameter<double>("BPix_SignalResponse_p0")),
301  BPix_p1(conf.getParameter<double>("BPix_SignalResponse_p1")),
302  BPix_p2(conf.getParameter<double>("BPix_SignalResponse_p2")),
303  BPix_p3(conf.getParameter<double>("BPix_SignalResponse_p3")),
304 
305  // Add noise
306  addNoise(conf.getParameter<bool>("AddNoise")),
307 
308  // Smear the pixel charge with a gaussian which RMS is a function of the
309  // pixel charge (Danek's study)
310  addChargeVCALSmearing(conf.getParameter<bool>("ChargeVCALSmearing")),
311 
312  // Add noisy pixels
313  addNoisyPixels(conf.getParameter<bool>("AddNoisyPixels")),
314 
315  // Fluctuate charge in track subsegments
316  fluctuateCharge(conf.getUntrackedParameter<bool>("FluctuateCharge", true)),
317 
318  // Control the pixel inefficiency
319  AddPixelInefficiency(conf.getParameter<bool>("AddPixelInefficiency")),
320  KillBadFEDChannels(conf.getParameter<bool>("KillBadFEDChannels")),
321 
322  // Add threshold gaussian smearing:
323  addThresholdSmearing(conf.getParameter<bool>("AddThresholdSmearing")),
324 
325  // Get the constants for the miss-calibration studies
326  doMissCalibrate(conf.getParameter<bool>("MissCalibrate")), // Enable miss-calibration
327  theGainSmearing(conf.getParameter<double>("GainSmearing")), // sigma of the gain smearing
328  theOffsetSmearing(conf.getParameter<double>("OffsetSmearing")), //sigma of the offset smearing
329 
330  // Add pixel radiation damage for upgrade studies
331  AddPixelAging(conf.getParameter<bool>("DoPixelAging")),
332  UseReweighting(conf.getParameter<bool>("UseReweighting")),
333  PrintClusters(conf.getParameter<bool>("PrintClusters")),
334  PrintTemplates(conf.getParameter<bool>("PrintTemplates")),
335 
336  // delta cutoff in MeV, has to be same as in OSCAR(0.030/cmsim=1.0 MeV
337  //tMax(0.030), // In MeV.
338  //tMax(conf.getUntrackedParameter<double>("deltaProductionCut",0.030)),
339  tMax(conf.getParameter<double>("deltaProductionCut")),
340 
342  theNoiser(addNoise ? new GaussianTailNoiseGenerator() : nullptr),
343  calmap(doMissCalibrate ? initCal() : std::map<int, CalParameters, std::less<int> >()),
345  : nullptr),
348  LogInfo("PixelDigitizer ") << "SiPixelDigitizerAlgorithm constructed"
349  << "Configuration parameters:"
350  << "Threshold/Gain = "
351  << "threshold in electron FPix = " << theThresholdInE_FPix
352  << "threshold in electron BPix = " << theThresholdInE_BPix
353  << "threshold in electron BPix Layer1 = " << theThresholdInE_BPix_L1
354  << "threshold in electron BPix Layer2 = " << theThresholdInE_BPix_L2 << " "
355  << theElectronPerADC << " " << theAdcFullScale << " The delta cut-off is set to " << tMax
356  << " pix-inefficiency " << AddPixelInefficiency;
357 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< int, CalParameters, std::less< int > > initCal() const
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
#define TXSIZE
const std::unique_ptr< SiG4UniversalFluctuation > fluctuate
bool exists(std::string const &parameterName) const
checks if a parameter exists
vector< ParameterSet > Parameters
const std::map< int, CalParameters, std::less< int > > calmap
const std::unique_ptr< GaussianTailNoiseGenerator > theNoiser
#define TYSIZE
std::vector< SiPixelTemplateStore2D > templateStores_
std::vector< edm::ParameterSet > Parameters
SiPixelDigitizerAlgorithm::~SiPixelDigitizerAlgorithm ( )

Definition at line 449 of file SiPixelDigitizerAlgorithm.cc.

References LogDebug.

449  {
450  LogDebug("PixelDigitizer") << "SiPixelDigitizerAlgorithm deleted";
451 }
#define LogDebug(id)

Member Function Documentation

void SiPixelDigitizerAlgorithm::accumulateSimHits ( const std::vector< PSimHit >::const_iterator  inputBegin,
const std::vector< PSimHit >::const_iterator  inputEnd,
const size_t  inputBeginGlobalIndex,
const unsigned int  tofBin,
const PixelGeomDetUnit pixdet,
const GlobalVector bfield,
const TrackerTopology tTopo,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 780 of file SiPixelDigitizerAlgorithm.cc.

References drift(), GeomDet::geographicalId(), induce_signal(), LogDebug, mag(), primary_ionization(), DetId::rawId(), GeomDet::surface(), theTofLowerCut, theTofUpperCut, and Surface::toGlobal().

787  {
788  // produce SignalPoint's for all SimHit's in detector
789  // Loop over hits
790 
791  uint32_t detId = pixdet->geographicalId().rawId();
792  size_t simHitGlobalIndex = inputBeginGlobalIndex; // This needs to stored to create the digi-sim link later
793  for (std::vector<PSimHit>::const_iterator ssbegin = inputBegin; ssbegin != inputEnd; ++ssbegin, ++simHitGlobalIndex) {
794  // skip hits not in this detector.
795  if ((*ssbegin).detUnitId() != detId) {
796  continue;
797  }
798 
799 #ifdef TP_DEBUG
800  LogDebug("Pixel Digitizer") << (*ssbegin).particleType() << " " << (*ssbegin).pabs() << " "
801  << (*ssbegin).energyLoss() << " " << (*ssbegin).tof() << " " << (*ssbegin).trackId()
802  << " " << (*ssbegin).processType() << " " << (*ssbegin).detUnitId()
803  << (*ssbegin).entryPoint() << " " << (*ssbegin).exitPoint();
804 #endif
805 
806  std::vector<EnergyDepositUnit> ionization_points;
807  std::vector<SignalPoint> collection_points;
808 
809  // fill collection_points for this SimHit, indpendent of topology
810  // Check the TOF cut
811  if (((*ssbegin).tof() - pixdet->surface().toGlobal((*ssbegin).localPosition()).mag() / 30.) >= theTofLowerCut &&
812  ((*ssbegin).tof() - pixdet->surface().toGlobal((*ssbegin).localPosition()).mag() / 30.) <= theTofUpperCut) {
813  primary_ionization(*ssbegin, ionization_points, engine); // fills _ionization_points
814  drift(*ssbegin,
815  pixdet,
816  bfield,
817  tTopo,
818  ionization_points,
819  collection_points); // transforms _ionization_points to collection_points
820  // compute induced signal on readout elements and add to _signal
821  induce_signal(inputBegin,
822  inputEnd,
823  *ssbegin,
824  simHitGlobalIndex,
825  tofBin,
826  pixdet,
827  collection_points); // 1st 3 args needed only for SimHit<-->Digi link
828  } // end if
829  } // end for
830 }
#define LogDebug(id)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:81
void induce_signal(std::vector< PSimHit >::const_iterator inputBegin, std::vector< PSimHit >::const_iterator inputEnd, const PSimHit &hit, const size_t hitIndex, const unsigned int tofBin, const PixelGeomDetUnit *pixdet, const std::vector< SignalPoint > &collection_points)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
void primary_ionization(const PSimHit &hit, std::vector< EnergyDepositUnit > &ionization_points, CLHEP::HepRandomEngine *) const
void drift(const PSimHit &hit, const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const TrackerTopology *tTopo, const std::vector< EnergyDepositUnit > &ionization_points, std::vector< SignalPoint > &collection_points) const
void SiPixelDigitizerAlgorithm::add_noise ( const PixelGeomDetUnit pixdet,
float  thePixelThreshold,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 1656 of file SiPixelDigitizerAlgorithm.cc.

References _signal, addChargeVCALSmearing, addNoisyPixels, LaserClient_cfi::Amplitude, officialStyle::chan, GeomDet::geographicalId(), mps_fire::i, createfilelist::int, LogDebug, PixelTopology::ncolumns(), hgcalDigitizer_cfi::noise, PixelTopology::nrows(), PixelDigi::pixelToChannel(), DetId::rawId(), PixelGeomDetUnit::specificTopology(), theNoiseInElectrons, theNoiser, theReadoutNoise, theThresholdInE_BPix, and theThresholdInE_FPix.

Referenced by digitize().

1658  {
1659 #ifdef TP_DEBUG
1660  LogDebug("Pixel Digitizer") << " enter add_noise " << theNoiseInElectrons;
1661 #endif
1662 
1663  uint32_t detID = pixdet->geographicalId().rawId();
1664  signal_map_type& theSignal = _signal[detID];
1665 
1666  // First add noise to hit pixels
1667  float theSmearedChargeRMS = 0.0;
1668 
1669  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); i++) {
1670  if (addChargeVCALSmearing) {
1671  if ((*i).second < 3000) {
1672  theSmearedChargeRMS = 543.6 - (*i).second * 0.093;
1673  } else if ((*i).second < 6000) {
1674  theSmearedChargeRMS = 307.6 - (*i).second * 0.01;
1675  } else {
1676  theSmearedChargeRMS = -432.4 + (*i).second * 0.123;
1677  }
1678 
1679  // Noise from Vcal smearing:
1680  float noise_ChargeVCALSmearing = theSmearedChargeRMS * CLHEP::RandGaussQ::shoot(engine, 0., 1.);
1681  // Noise from full readout:
1682  float noise = CLHEP::RandGaussQ::shoot(engine, 0., theReadoutNoise);
1683 
1684  if (((*i).second + Amplitude(noise + noise_ChargeVCALSmearing, -1.)) < 0.) {
1685  (*i).second.set(0);
1686  } else {
1687  (*i).second += Amplitude(noise + noise_ChargeVCALSmearing, -1.);
1688  }
1689 
1690  } // End if addChargeVCalSmearing
1691  else {
1692  // Noise: ONLY full READOUT Noise.
1693  // Use here the FULL readout noise, including TBM,ALT,AOH,OPT-REC.
1694  float noise = CLHEP::RandGaussQ::shoot(engine, 0., theReadoutNoise);
1695 
1696  if (((*i).second + Amplitude(noise, -1.)) < 0.) {
1697  (*i).second.set(0);
1698  } else {
1699  (*i).second += Amplitude(noise, -1.);
1700  }
1701  } // end if only Noise from full readout
1702  }
1703 
1704  if (!addNoisyPixels) // Option to skip noise in non-hit pixels
1705  return;
1706 
1707  const PixelTopology* topol = &pixdet->specificTopology();
1708  int numColumns = topol->ncolumns(); // det module number of cols&rows
1709  int numRows = topol->nrows();
1710 
1711  // Add noise on non-hit pixels
1712  // Use here the pixel noise
1713  int numberOfPixels = (numRows * numColumns);
1714  std::map<int, float, std::less<int> > otherPixels;
1715  std::map<int, float, std::less<int> >::iterator mapI;
1716 
1717  theNoiser->generate(numberOfPixels,
1718  thePixelThreshold, //thr. in un. of nois
1719  theNoiseInElectrons, // noise in elec.
1720  otherPixels,
1721  engine);
1722 
1723 #ifdef TP_DEBUG
1724  LogDebug("Pixel Digitizer") << " Add noisy pixels " << numRows << " " << numColumns << " " << theNoiseInElectrons
1725  << " " << theThresholdInE_FPix << theThresholdInE_BPix << " " << numberOfPixels << " "
1726  << otherPixels.size();
1727 #endif
1728 
1729  // Add noisy pixels
1730  for (mapI = otherPixels.begin(); mapI != otherPixels.end(); mapI++) {
1731  int iy = ((*mapI).first) / numRows;
1732  int ix = ((*mapI).first) - (iy * numRows);
1733 
1734  // Keep for a while for testing.
1735  if (iy < 0 || iy > (numColumns - 1))
1736  LogWarning("Pixel Geometry") << " error in iy " << iy;
1737  if (ix < 0 || ix > (numRows - 1))
1738  LogWarning("Pixel Geometry") << " error in ix " << ix;
1739 
1740  int chan = PixelDigi::pixelToChannel(ix, iy);
1741 
1742 #ifdef TP_DEBUG
1743  LogDebug("Pixel Digitizer") << " Storing noise = " << (*mapI).first << " " << (*mapI).second << " " << ix << " "
1744  << iy << " " << chan;
1745 #endif
1746 
1747  if (theSignal[chan] == 0) {
1748  // float noise = float( (*mapI).second );
1749  int noise = int((*mapI).second);
1750  theSignal[chan] = Amplitude(noise, -1.);
1751  }
1752  }
1753 }
#define LogDebug(id)
virtual int nrows() const =0
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:71
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
signal_map_type::iterator signal_map_iterator
const std::unique_ptr< GaussianTailNoiseGenerator > theNoiser
std::map< int, Amplitude, std::less< int > > signal_map_type
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
virtual int ncolumns() const =0
double SiPixelDigitizerAlgorithm::calcQ ( float  x) const
inlineprivate

Definition at line 485 of file SiPixelDigitizerAlgorithm.h.

References f, min(), mathSSE::sqrt(), and geometryCSVtoXML::xx.

Referenced by induce_signal().

485  {
486  // need erf(x/sqrt2)
487  //float x2=0.5*x*x;
488  //float a=0.147;
489  //double erf=sqrt(1.0f-exp( -1.0f*x2*( (4/M_PI)+a*x2)/(1.0+a*x2)));
490  //if (x<0.) erf*=-1.0;
491  //return 0.5*(1.0-erf);
492 
493  auto xx = std::min(0.5f * x * x, 12.5f);
494  return 0.5 * (1.0 - std::copysign(std::sqrt(1.f - unsafe_expf<4>(-xx * (1.f + 0.2733f / (1.f + 0.147f * xx)))), x));
495  }
T sqrt(T t)
Definition: SSEVec.h:19
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
void SiPixelDigitizerAlgorithm::calculateInstlumiFactor ( PileupMixingContent puInfo)

Definition at line 833 of file SiPixelDigitizerAlgorithm.cc.

References PileupMixingContent::getMix_bunchCrossing(), PileupMixingContent::getMix_TrueInteractions(), mps_fire::i, dqmiolumiharvest::j, dqmiodumpmetadata::n, AlCaHLTBitMon_ParallelJobs::p, pixelEfficiencies_, muons2muons_cfi::pu, SiPixelDigitizerAlgorithm::PixelEfficiencies::pu_scale, SiPixelDigitizerAlgorithm::PixelEfficiencies::theInstLumiScaleFactor, and SiPixelDigitizerAlgorithm::PixelEfficiencies::thePUEfficiency.

Referenced by PreMixingSiPixelWorker::put().

833  {
834  //Instlumi scalefactor calculating for dynamic inefficiency
835 
836  if (puInfo) {
837  const std::vector<int>& bunchCrossing = puInfo->getMix_bunchCrossing();
838  const std::vector<float>& TrueInteractionList = puInfo->getMix_TrueInteractions();
839  //const int bunchSpacing = puInfo->getMix_bunchSpacing();
840 
841  int pui = 0, p = 0;
842  std::vector<int>::const_iterator pu;
843  std::vector<int>::const_iterator pu0 = bunchCrossing.end();
844 
845  for (pu = bunchCrossing.begin(); pu != bunchCrossing.end(); ++pu) {
846  if (*pu == 0) {
847  pu0 = pu;
848  p = pui;
849  }
850  pui++;
851  }
852  if (pu0 != bunchCrossing.end()) {
853  for (size_t i = 0, n = pixelEfficiencies_.thePUEfficiency.size(); i < n; i++) {
854  double instlumi = TrueInteractionList.at(p) * pixelEfficiencies_.theInstLumiScaleFactor;
855  double instlumi_pow = 1.;
857  for (size_t j = 0; j < pixelEfficiencies_.thePUEfficiency[i].size(); j++) {
859  instlumi_pow *= instlumi;
860  }
861  }
862  }
863  } else {
864  for (int i = 0, n = pixelEfficiencies_.thePUEfficiency.size(); i < n; i++) {
866  }
867  }
868 }
const std::vector< float > & getMix_TrueInteractions() const
const std::vector< int > & getMix_bunchCrossing() const
std::vector< std::vector< double > > thePUEfficiency
void SiPixelDigitizerAlgorithm::calculateInstlumiFactor ( const std::vector< PileupSummaryInfo > &  ps,
int  bunchSpacing 
)

Definition at line 871 of file SiPixelDigitizerAlgorithm.cc.

References mps_fire::i, dqmiolumiharvest::j, dqmiodumpmetadata::n, AlCaHLTBitMon_ParallelJobs::p, pixelEfficiencies_, SiPixelDigitizerAlgorithm::PixelEfficiencies::pu_scale, SiPixelDigitizerAlgorithm::PixelEfficiencies::theInstLumiScaleFactor, and SiPixelDigitizerAlgorithm::PixelEfficiencies::thePUEfficiency.

871  {
872  int p = -1;
873  for (unsigned int i = 0; i < ps.size(); i++)
874  if (ps[i].getBunchCrossing() == 0)
875  p = i;
876 
877  if (p >= 0) {
878  for (size_t i = 0, n = pixelEfficiencies_.thePUEfficiency.size(); i < n; i++) {
879  double instlumi = ps[p].getTrueNumInteractions() * pixelEfficiencies_.theInstLumiScaleFactor;
880  double instlumi_pow = 1.;
882  for (size_t j = 0; j < pixelEfficiencies_.thePUEfficiency[i].size(); j++) {
884  instlumi_pow *= instlumi;
885  }
886  }
887  } else {
888  for (int i = 0, n = pixelEfficiencies_.thePUEfficiency.size(); i < n; i++) {
890  }
891  }
892 }
std::vector< std::vector< double > > thePUEfficiency
std::unique_ptr< PixelFEDChannelCollection > SiPixelDigitizerAlgorithm::chooseScenario ( PileupMixingContent puInfo,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 945 of file SiPixelDigitizerAlgorithm.cc.

References PileupMixingContent::getMix_bunchCrossing(), PileupMixingContent::getMix_TrueInteractions(), SiPixelQualityProbabilities::getProbabilities(), AlCaHLTBitMon_ParallelJobs::p, pixelEfficiencies_, SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelFEDChannelCollection_, muons2muons_cfi::pu, quality_map, MisalignedTracker_cfi::scenario, scenarioProbabilityHandle, AlCaHLTBitMon_QueryRunRegistry::string, and x.

Referenced by PreMixingSiPixelWorker::put().

946  {
947  //Determine scenario to use for the current event based on pileup information
948 
949  std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ = nullptr;
951  if (puInfo) {
952  const std::vector<int>& bunchCrossing = puInfo->getMix_bunchCrossing();
953  const std::vector<float>& TrueInteractionList = puInfo->getMix_TrueInteractions();
954 
955  int pui = 0, p = 0;
956  std::vector<int>::const_iterator pu;
957  std::vector<int>::const_iterator pu0 = bunchCrossing.end();
958 
959  for (pu = bunchCrossing.begin(); pu != bunchCrossing.end(); ++pu) {
960  if (*pu == 0) {
961  pu0 = pu;
962  p = pui;
963  }
964  pui++;
965  }
966 
967  if (pu0 != bunchCrossing.end()) {
968  unsigned int PUBin = TrueInteractionList.at(p); // case delta PU=1, fix me
969  const auto& theProbabilitiesPerScenario = scenarioProbabilityHandle->getProbabilities(PUBin);
970  std::vector<double> probabilities;
971  probabilities.reserve(theProbabilitiesPerScenario.size());
972  for (auto it = theProbabilitiesPerScenario.begin(); it != theProbabilitiesPerScenario.end(); it++) {
973  probabilities.push_back(it->second);
974  }
975 
976  CLHEP::RandGeneral randGeneral(*engine, &(probabilities.front()), probabilities.size());
977  double x = randGeneral.shoot();
978  unsigned int index = x * probabilities.size() - 1;
979  const std::string& scenario = theProbabilitiesPerScenario.at(index).first;
980 
981  PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
983  std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
984  }
985  }
986  return PixelFEDChannelCollection_;
987 }
const std::vector< float > & getMix_TrueInteractions() const
probabilityVec getProbabilities(const unsigned int puBin) const
edm::ESHandle< SiPixelQualityProbabilities > scenarioProbabilityHandle
const std::vector< int > & getMix_bunchCrossing() const
std::unique_ptr< PixelFEDChannelCollection > PixelFEDChannelCollection_
const PixelFEDChannelCollectionMap * quality_map
std::unique_ptr< PixelFEDChannelCollection > SiPixelDigitizerAlgorithm::chooseScenario ( const std::vector< PileupSummaryInfo > &  ps,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 898 of file SiPixelDigitizerAlgorithm.cc.

References SiPixelQualityProbabilities::getProbabilities(), mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, pixelEfficiencies_, SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelFEDChannelCollection_, muons2muons_cfi::pu, quality_map, MisalignedTracker_cfi::scenario, scenarioProbabilityHandle, AlCaHLTBitMon_QueryRunRegistry::string, and x.

899  {
900  std::unique_ptr<PixelFEDChannelCollection> PixelFEDChannelCollection_ = nullptr;
902 
903  std::vector<int> bunchCrossing;
904  std::vector<float> TrueInteractionList;
905 
906  for (unsigned int i = 0; i < ps.size(); i++) {
907  bunchCrossing.push_back(ps[i].getBunchCrossing());
908  TrueInteractionList.push_back(ps[i].getTrueNumInteractions());
909  }
910 
911  int pui = 0, p = 0;
912  std::vector<int>::const_iterator pu;
913  std::vector<int>::const_iterator pu0 = bunchCrossing.end();
914 
915  for (pu = bunchCrossing.begin(); pu != bunchCrossing.end(); ++pu) {
916  if (*pu == 0) {
917  pu0 = pu;
918  p = pui;
919  }
920  pui++;
921  }
922 
923  if (pu0 != bunchCrossing.end()) {
924  unsigned int PUBin = TrueInteractionList.at(p); // case delta PU=1, fix me
925  const auto& theProbabilitiesPerScenario = scenarioProbabilityHandle->getProbabilities(PUBin);
926  std::vector<double> probabilities;
927  probabilities.reserve(theProbabilitiesPerScenario.size());
928  for (auto it = theProbabilitiesPerScenario.begin(); it != theProbabilitiesPerScenario.end(); it++) {
929  probabilities.push_back(it->second);
930  }
931 
932  CLHEP::RandGeneral randGeneral(*engine, &(probabilities.front()), probabilities.size());
933  double x = randGeneral.shoot();
934  unsigned int index = x * probabilities.size() - 1;
935  const std::string& scenario = theProbabilitiesPerScenario.at(index).first;
936 
937  PixelFEDChannelCollection_ = std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
939  std::make_unique<PixelFEDChannelCollection>(quality_map->at(scenario));
940  }
941 
942  return PixelFEDChannelCollection_;
943 }
probabilityVec getProbabilities(const unsigned int puBin) const
edm::ESHandle< SiPixelQualityProbabilities > scenarioProbabilityHandle
std::unique_ptr< PixelFEDChannelCollection > PixelFEDChannelCollection_
const PixelFEDChannelCollectionMap * quality_map
void SiPixelDigitizerAlgorithm::digitize ( const PixelGeomDetUnit pixdet,
std::vector< PixelDigi > &  digis,
std::vector< PixelDigiSimLink > &  simlinks,
const TrackerTopology tTopo,
CLHEP::HepRandomEngine *  engine 
)

Definition at line 1001 of file SiPixelDigitizerAlgorithm.cc.

References _signal, add_noise(), addNoise, AddPixelInefficiency, addThresholdSmearing, Surface::bounds(), Exception, GeomDet::geographicalId(), GeomDetType::isBarrel(), GeomDetType::isTrackerPixel(), TrackerTopology::layer(), LogDebug, make_digis(), module_killing_conf(), module_killing_DB(), PixelTopology::ncolumns(), PixelTopology::nrows(), GeomDetEnumerators::P1PXB, pixel_inefficiency(), pixel_inefficiency_db(), GeomDetEnumerators::PixelBarrel, pixelEfficiencies_, DetId::rawId(), GeomDet::specificSurface(), PixelGeomDetUnit::specificTopology(), GeomDet::subDetector(), theNoiseInElectrons, theThresholdInE_BPix, theThresholdInE_BPix_L1, theThresholdInE_BPix_L2, theThresholdInE_FPix, theThresholdSmearing_BPix, theThresholdSmearing_BPix_L1, theThresholdSmearing_BPix_L2, theThresholdSmearing_FPix, Bounds::thickness(), PixelGeomDetUnit::type(), use_deadmodule_DB_, use_ineff_from_db_, and use_module_killing_.

Referenced by PreMixingSiPixelWorker::put().

1005  {
1006  // Pixel Efficiency moved from the constructor to this method because
1007  // the information of the det are not available in the constructor
1008  // Efficiency parameters. 0 - no inefficiency, 1-low lumi, 10-high lumi
1009 
1010  uint32_t detID = pixdet->geographicalId().rawId();
1011  const signal_map_type& theSignal = _signal[detID];
1012 
1013  // Noise already defined in electrons
1014  // thePixelThresholdInE = thePixelThreshold * theNoiseInElectrons ;
1015  // Find the threshold in noise units, needed for the noiser.
1016 
1017  float thePixelThresholdInE = 0.;
1018 
1019  if (theNoiseInElectrons > 0.) {
1020  if (pixdet->type().isTrackerPixel() && pixdet->type().isBarrel()) { // Barrel modules
1021  int lay = tTopo->layer(detID);
1022  if (addThresholdSmearing) {
1025  if (lay == 1) {
1026  thePixelThresholdInE = CLHEP::RandGaussQ::shoot(
1027  engine, theThresholdInE_BPix_L1, theThresholdSmearing_BPix_L1); // gaussian smearing
1028  } else if (lay == 2) {
1029  thePixelThresholdInE = CLHEP::RandGaussQ::shoot(
1030  engine, theThresholdInE_BPix_L2, theThresholdSmearing_BPix_L2); // gaussian smearing
1031  } else {
1032  thePixelThresholdInE =
1033  CLHEP::RandGaussQ::shoot(engine, theThresholdInE_BPix, theThresholdSmearing_BPix); // gaussian smearing
1034  }
1035  }
1036  } else {
1039  if (lay == 1) {
1040  thePixelThresholdInE = theThresholdInE_BPix_L1;
1041  } else if (lay == 2) {
1042  thePixelThresholdInE = theThresholdInE_BPix_L2;
1043  } else {
1044  thePixelThresholdInE = theThresholdInE_BPix; // no smearing
1045  }
1046  }
1047  }
1048  } else if (pixdet->type().isTrackerPixel()) { // Forward disks modules
1049  if (addThresholdSmearing) {
1050  thePixelThresholdInE =
1051  CLHEP::RandGaussQ::shoot(engine, theThresholdInE_FPix, theThresholdSmearing_FPix); // gaussian smearing
1052  } else {
1053  thePixelThresholdInE = theThresholdInE_FPix; // no smearing
1054  }
1055  } else {
1056  throw cms::Exception("NotAPixelGeomDetUnit") << "Not a pixel geomdet unit" << detID;
1057  }
1058  }
1059 
1060 #ifdef TP_DEBUG
1061  const PixelTopology* topol = &pixdet->specificTopology();
1062  int numColumns = topol->ncolumns(); // det module number of cols&rows
1063  int numRows = topol->nrows();
1064  // full detector thickness
1065  float moduleThickness = pixdet->specificSurface().bounds().thickness();
1066  LogDebug("PixelDigitizer") << " PixelDigitizer " << numColumns << " " << numRows << " " << moduleThickness;
1067 #endif
1068 
1069  if (addNoise)
1070  add_noise(pixdet, thePixelThresholdInE / theNoiseInElectrons, engine); // generate noise
1071 
1072  // Do only if needed
1073 
1074  if ((AddPixelInefficiency) && (!theSignal.empty()))
1075  pixel_inefficiency(pixelEfficiencies_, pixdet, tTopo, engine); // Kill some pixels
1076 
1077  if (use_ineff_from_db_ && (!theSignal.empty()))
1078  pixel_inefficiency_db(detID);
1079 
1080  if (use_module_killing_) {
1081  if (use_deadmodule_DB_) { // remove dead modules using DB
1082  module_killing_DB(detID);
1083  } else { // remove dead modules using the list in cfg file
1084  module_killing_conf(detID);
1085  }
1086  }
1087 
1088  make_digis(thePixelThresholdInE, detID, pixdet, digis, simlinks, tTopo);
1089 
1090 #ifdef TP_DEBUG
1091  LogDebug("PixelDigitizer") << "[SiPixelDigitizerAlgorithm] converted " << digis.size() << " PixelDigis in DetUnit"
1092  << detID;
1093 #endif
1094 }
#define LogDebug(id)
virtual int nrows() const =0
const GeomDetType & type() const override
void pixel_inefficiency_db(uint32_t detID)
bool isBarrel() const
Definition: GeomDetType.cc:9
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Bounds & bounds() const
Definition: Surface.h:89
void make_digis(float thePixelThresholdInE, uint32_t detID, const PixelGeomDetUnit *pixdet, std::vector< PixelDigi > &digis, std::vector< PixelDigiSimLink > &simlinks, const TrackerTopology *tTopo) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
bool isTrackerPixel() const
Definition: GeomDetType.cc:15
std::map< int, Amplitude, std::less< int > > signal_map_type
virtual float thickness() const =0
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
unsigned int layer(const DetId &id) const
virtual int ncolumns() const =0
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
void add_noise(const PixelGeomDetUnit *pixdet, float thePixelThreshold, CLHEP::HepRandomEngine *)
void pixel_inefficiency(const PixelEfficiencies &eff, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo, CLHEP::HepRandomEngine *)
void SiPixelDigitizerAlgorithm::drift ( const PSimHit hit,
const PixelGeomDetUnit pixdet,
const GlobalVector bfield,
const TrackerTopology tTopo,
const std::vector< EnergyDepositUnit > &  ionization_points,
std::vector< SignalPoint > &  collection_points 
) const
private

Definition at line 1231 of file SiPixelDigitizerAlgorithm.cc.

References AddPixelAging, alpha2Order, Surface::bounds(), PSimHit::detUnitId(), Dist300, DriftDirection(), JetChargeProducer_cfi::exp, mps_fire::i, LogDebug, pixel_aging(), pixelAging_, Sigma0, GeomDet::specificSurface(), mathSSE::sqrt(), Bounds::thickness(), PSimHit::tof(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by accumulateSimHits().

1236  {
1237 #ifdef TP_DEBUG
1238  LogDebug("Pixel Digitizer") << " enter drift ";
1239 #endif
1240 
1241  collection_points.resize(ionization_points.size()); // set size
1242 
1243  LocalVector driftDir = DriftDirection(pixdet, bfield, hit.detUnitId()); // get the charge drift direction
1244  if (driftDir.z() == 0.) {
1245  LogWarning("Magnetic field") << " pxlx: drift in z is zero ";
1246  return;
1247  }
1248 
1249  // tangent of Lorentz angle
1250  //float TanLorenzAngleX = driftDir.x()/driftDir.z();
1251  //float TanLorenzAngleY = 0.; // force to 0, driftDir.y()/driftDir.z();
1252 
1253  float TanLorenzAngleX, TanLorenzAngleY, dir_z, CosLorenzAngleX, CosLorenzAngleY;
1254  if (alpha2Order) {
1255  TanLorenzAngleX = driftDir.x(); // tangen of Lorentz angle
1256  TanLorenzAngleY = driftDir.y();
1257  dir_z = driftDir.z(); // The z drift direction
1258  CosLorenzAngleX = 1. / sqrt(1. + TanLorenzAngleX * TanLorenzAngleX); //cosine
1259  CosLorenzAngleY = 1. / sqrt(1. + TanLorenzAngleY * TanLorenzAngleY); //cosine;
1260 
1261  } else {
1262  TanLorenzAngleX = driftDir.x();
1263  TanLorenzAngleY = 0.; // force to 0, driftDir.y()/driftDir.z();
1264  dir_z = driftDir.z(); // The z drift direction
1265  CosLorenzAngleX = 1. / sqrt(1. + TanLorenzAngleX * TanLorenzAngleX); //cosine to estimate the path length
1266  CosLorenzAngleY = 1.;
1267  }
1268 
1269  float moduleThickness = pixdet->specificSurface().bounds().thickness();
1270 #ifdef TP_DEBUG
1271  LogDebug("Pixel Digitizer") << " Lorentz Tan " << TanLorenzAngleX << " " << TanLorenzAngleY << " " << CosLorenzAngleX
1272  << " " << CosLorenzAngleY << " " << moduleThickness * TanLorenzAngleX << " " << driftDir;
1273 #endif
1274 
1275  float Sigma_x = 1.; // Charge spread
1276  float Sigma_y = 1.;
1277  float DriftDistance; // Distance between charge generation and collection
1278  float DriftLength; // Actual Drift Lentgh
1279  float Sigma;
1280 
1281  for (unsigned int i = 0; i != ionization_points.size(); i++) {
1282  float SegX, SegY, SegZ; // position
1283  SegX = ionization_points[i].x();
1284  SegY = ionization_points[i].y();
1285  SegZ = ionization_points[i].z();
1286 
1287  // Distance from the collection plane
1288  //DriftDistance = (moduleThickness/2. + SegZ); // Drift to -z
1289  // Include explixitely the E drift direction (for CMS dir_z=-1)
1290  DriftDistance = moduleThickness / 2. - (dir_z * SegZ); // Drift to -z
1291 
1292  //if( DriftDistance <= 0.)
1293  //cout<<" <=0 "<<DriftDistance<<" "<<i<<" "<<SegZ<<" "<<dir_z<<" "
1294  // <<SegX<<" "<<SegY<<" "<<(moduleThickness/2)<<" "
1295  // <<ionization_points[i].energy()<<" "
1296  // <<hit.particleType()<<" "<<hit.pabs()<<" "<<hit.energyLoss()<<" "
1297  // <<hit.entryPoint()<<" "<<hit.exitPoint()
1298  // <<std::endl;
1299 
1300  if (DriftDistance < 0.) {
1301  DriftDistance = 0.;
1302  } else if (DriftDistance > moduleThickness)
1303  DriftDistance = moduleThickness;
1304 
1305  // Assume full depletion now, partial depletion will come later.
1306  float XDriftDueToMagField = DriftDistance * TanLorenzAngleX;
1307  float YDriftDueToMagField = DriftDistance * TanLorenzAngleY;
1308 
1309  // Shift cloud center
1310  float CloudCenterX = SegX + XDriftDueToMagField;
1311  float CloudCenterY = SegY + YDriftDueToMagField;
1312 
1313  // Calculate how long is the charge drift path
1314  DriftLength = sqrt(DriftDistance * DriftDistance + XDriftDueToMagField * XDriftDueToMagField +
1315  YDriftDueToMagField * YDriftDueToMagField);
1316 
1317  // What is the charge diffusion after this path
1318  Sigma = sqrt(DriftLength / Dist300) * Sigma0;
1319 
1320  // Project the diffusion sigma on the collection plane
1321  Sigma_x = Sigma / CosLorenzAngleX;
1322  Sigma_y = Sigma / CosLorenzAngleY;
1323 
1324  // Insert a charge loss due to Rad Damage here
1325  float energyOnCollector = ionization_points[i].energy(); // The energy that reaches the collector
1326 
1327  // add pixel aging
1328  if (AddPixelAging) {
1329  float kValue = pixel_aging(pixelAging_, pixdet, tTopo);
1330  energyOnCollector *= exp(-1 * kValue * DriftDistance / moduleThickness);
1331  }
1332 
1333 #ifdef TP_DEBUG
1334  LogDebug("Pixel Digitizer") << " Dift DistanceZ= " << DriftDistance << " module thickness= " << moduleThickness
1335  << " Start Energy= " << ionization_points[i].energy()
1336  << " Energy after loss= " << energyOnCollector;
1337 #endif
1338  SignalPoint sp(CloudCenterX, CloudCenterY, Sigma_x, Sigma_y, hit.tof(), energyOnCollector);
1339 
1340  // Load the Charge distribution parameters
1341  collection_points[i] = (sp);
1342 
1343  } // loop over ionization points, i.
1344 
1345 } // end drift
#define LogDebug(id)
float tof() const
deprecated name for timeOfFlight()
Definition: PSimHit.h:76
LocalVector DriftDirection(const PixelGeomDetUnit *pixdet, const GlobalVector &bfield, const DetId &detId) const
T y() const
Definition: PV3DBase.h:60
const Bounds & bounds() const
Definition: Surface.h:89
float pixel_aging(const PixelAging &aging, const PixelGeomDetUnit *pixdet, const TrackerTopology *tTopo) const
T sqrt(T t)
Definition: SSEVec.h:19
T z() const
Definition: PV3DBase.h:61
virtual float thickness() const =0
T x() const
Definition: PV3DBase.h:59
unsigned int detUnitId() const
Definition: PSimHit.h:97
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
LocalVector SiPixelDigitizerAlgorithm::DriftDirection ( const PixelGeomDetUnit pixdet,
const GlobalVector bfield,
const DetId detId 
) const
private

Definition at line 2128 of file SiPixelDigitizerAlgorithm.cc.

References alpha2Order, Exception, GeomDet::geographicalId(), SiPixelLorentzAngle::getLorentzAngle(), GeomDetType::isBarrel(), GeomDetType::isTrackerPixel(), LogDebug, GloballyPositioned< T >::position(), DetId::rawId(), GloballyPositioned< T >::rotation(), Scenarios_cff::scale, SiPixelLorentzAngle_, GeomDet::surface(), tanLorentzAnglePerTesla_BPix, tanLorentzAnglePerTesla_FPix, PixelGeomDetUnit::type(), and use_LorentzAngle_DB_.

Referenced by drift().

2130  {
2131  Frame detFrame(pixdet->surface().position(), pixdet->surface().rotation());
2132  LocalVector Bfield = detFrame.toLocal(bfield);
2133 
2134  float alpha2_FPix;
2135  float alpha2_BPix;
2136  float alpha2;
2137 
2138  //float dir_x = -tanLorentzAnglePerTesla * Bfield.y();
2139  //float dir_y = +tanLorentzAnglePerTesla * Bfield.x();
2140  //float dir_z = -1.; // E field always in z direction, so electrons go to -z
2141  // The dir_z has to be +/- 1. !
2142  // LocalVector theDriftDirection = LocalVector(dir_x,dir_y,dir_z);
2143 
2144  float dir_x = 0.0f;
2145  float dir_y = 0.0f;
2146  float dir_z = 0.0f;
2147  float scale = 0.0f;
2148 
2149  uint32_t detID = pixdet->geographicalId().rawId();
2150 
2151  // Read Lorentz angle from cfg file:**************************************************************
2152 
2153  if (!use_LorentzAngle_DB_) {
2154  if (alpha2Order) {
2157  } else {
2158  alpha2_FPix = 0.0f;
2159  alpha2_BPix = 0.0f;
2160  }
2161 
2162  if (pixdet->type().isTrackerPixel() && pixdet->type().isBarrel()) { // barrel layers
2163  dir_x = -(tanLorentzAnglePerTesla_BPix * Bfield.y() + alpha2_BPix * Bfield.z() * Bfield.x());
2164  dir_y = +(tanLorentzAnglePerTesla_BPix * Bfield.x() - alpha2_BPix * Bfield.z() * Bfield.y());
2165  dir_z = -(1 + alpha2_BPix * Bfield.z() * Bfield.z());
2166  scale = -dir_z;
2167  } else if (pixdet->type().isTrackerPixel()) { // forward disks
2168  dir_x = -(tanLorentzAnglePerTesla_FPix * Bfield.y() + alpha2_FPix * Bfield.z() * Bfield.x());
2169  dir_y = +(tanLorentzAnglePerTesla_FPix * Bfield.x() - alpha2_FPix * Bfield.z() * Bfield.y());
2170  dir_z = -(1 + alpha2_FPix * Bfield.z() * Bfield.z());
2171  scale = -dir_z;
2172  } else {
2173  throw cms::Exception("NotAPixelGeomDetUnit") << "Not a pixel geomdet unit" << detID;
2174  }
2175  } // end: Read LA from cfg file.
2176 
2177  //Read Lorentz angle from DB:********************************************************************
2178  if (use_LorentzAngle_DB_) {
2179  float lorentzAngle = SiPixelLorentzAngle_->getLorentzAngle(detId);
2180  alpha2 = lorentzAngle * lorentzAngle;
2181  //std::cout << "detID is: "<< it->first <<"The LA per tesla is: "<< it->second << std::std::endl;
2182  dir_x = -(lorentzAngle * Bfield.y() + alpha2 * Bfield.z() * Bfield.x());
2183  dir_y = +(lorentzAngle * Bfield.x() - alpha2 * Bfield.z() * Bfield.y());
2184  dir_z = -(1 + alpha2 * Bfield.z() * Bfield.z());
2185  scale = -dir_z;
2186  } // end: Read LA from DataBase.
2187 
2188  LocalVector theDriftDirection = LocalVector(dir_x / scale, dir_y / scale, dir_z / scale);
2189 
2190 #ifdef TP_DEBUG
2191  LogDebug("Pixel Digitizer") << " The drift direction in local coordinate is " << theDriftDirection;
2192 #endif
2193 
2194  return theDriftDirection;
2195 }
#define LogDebug(id)
const GeomDetType & type() const override
Local3DVector LocalVector
Definition: LocalVector.h:12
bool isBarrel() const
Definition: GeomDetType.cc:9
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
bool isTrackerPixel() const
Definition: GeomDetType.cc:15
edm::ESHandle< SiPixelLorentzAngle > SiPixelLorentzAngle_
GloballyPositioned< double > Frame
float getLorentzAngle(const uint32_t &) const
const RotationType & rotation() const
const PositionType & position() const
void SiPixelDigitizerAlgorithm::fluctuateEloss ( int  particleId,
float  momentum,
float  eloss,
float  length,
int  NumberOfSegments,
float  elossVector[],
CLHEP::HepRandomEngine *  engine 
) const
private

Definition at line 1165 of file SiPixelDigitizerAlgorithm.cc.

References funct::abs(), fluctuate, mps_fire::i, cuy::ii, particleFlowDisplacedVertex_cfi::ratio, and tMax.

Referenced by primary_ionization().

1171  {
1172  // Get dedx for this track
1173  //float dedx;
1174  //if( length > 0.) dedx = eloss/length;
1175  //else dedx = eloss;
1176 
1177  double particleMass = 139.6; // Mass in MeV, Assume pion
1178  pid = std::abs(pid);
1179  if (pid != 211) { // Mass in MeV
1180  if (pid == 11)
1181  particleMass = 0.511;
1182  else if (pid == 13)
1183  particleMass = 105.7;
1184  else if (pid == 321)
1185  particleMass = 493.7;
1186  else if (pid == 2212)
1187  particleMass = 938.3;
1188  }
1189  // What is the track segment length.
1190  float segmentLength = length / NumberOfSegs;
1191 
1192  // Generate charge fluctuations.
1193  float de = 0.;
1194  float sum = 0.;
1195  double segmentEloss = (1000. * eloss) / NumberOfSegs; //eloss in MeV
1196  for (int i = 0; i < NumberOfSegs; i++) {
1197  // material,*, momentum,energy,*, *, mass
1198  //myglandz_(14.,segmentLength,2.,2.,dedx,de,0.14);
1199  // The G4 routine needs momentum in MeV, mass in Mev, delta-cut in MeV,
1200  // track segment length in mm, segment eloss in MeV
1201  // Returns fluctuated eloss in MeV
1202  double deltaCutoff = tMax; // the cutoff is sometimes redefined inside, so fix it.
1203  de = fluctuate->SampleFluctuations(double(particleMomentum * 1000.),
1204  particleMass,
1205  deltaCutoff,
1206  double(segmentLength * 10.),
1207  segmentEloss,
1208  engine) /
1209  1000.; //convert to GeV
1210  elossVector[i] = de;
1211  sum += de;
1212  }
1213 
1214  if (sum > 0.) { // If fluctuations give eloss>0.
1215  // Rescale to the same total eloss
1216  float ratio = eloss / sum;
1217 
1218  for (int ii = 0; ii < NumberOfSegs; ii++)
1219  elossVector[ii] = ratio * elossVector[ii];
1220  } else { // If fluctuations gives 0 eloss
1221  float averageEloss = eloss / NumberOfSegs;
1222  for (int ii = 0; ii < NumberOfSegs; ii++)
1223  elossVector[ii] = averageEloss;
1224  }
1225  return;
1226 }
const std::unique_ptr< SiG4UniversalFluctuation > fluctuate
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ii
Definition: cuy.py:590
bool SiPixelDigitizerAlgorithm::hitSignalReweight ( const PSimHit hit,
std::map< int, float, std::less< int > > &  hit_signal,
const size_t  hitIndex,
const unsigned int  tofBin,
const PixelTopology topol,
uint32_t  detID,
signal_map_type theSignal,
unsigned short int  processType 
)
private

Definition at line 2333 of file SiPixelDigitizerAlgorithm.cc.

References LaserClient_cfi::Amplitude, officialStyle::chan, PixelDigi::channelToPixel(), ALCARECOTkAlJpsiMuMu_cff::charge, cuy::col, gather_cfg::cout, dbobject_den, dbobject_num, PSimHit::entryPoint(), PSimHit::exitPoint(), SiPixel2DTemplateDBObject::getTemplateID(), IDden, createfilelist::int, PixelTopology::isItBigPixelInX(), PixelTopology::isItBigPixelInY(), PSimHit::localPosition(), Topology::localPosition(), LogDebug, makeDigiSimLinks_, genParticles_cff::map, Topology::measurementPosition(), PixelTopology::ncolumns(), PixelTopology::nrows(), PSimHit::particleType(), PixelTempRewgt2D(), PixelDigi::pixelToChannel(), printCluster(), PrintClusters, PSimHit::processType(), THX, THY, track, TXSIZE, TYSIZE, UseReweighting, PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), xdouble, PV2DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::y(), ydouble, and PV3DBase< T, PVType, FrameType >::z().

Referenced by induce_signal().

2340  {
2341  int irow_min = topol->nrows();
2342  int irow_max = 0;
2343  int icol_min = topol->ncolumns();
2344  int icol_max = 0;
2345 
2346  float chargeBefore = 0;
2347  float chargeAfter = 0;
2348  signal_map_type hitSignal;
2349  LocalVector direction = hit.exitPoint() - hit.entryPoint();
2350 
2351  for (std::map<int, float, std::less<int> >::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
2352  int chan = (*im).first;
2353  std::pair<int, int> pixelWithCharge = PixelDigi::channelToPixel(chan);
2354  //std::cout << "PixelHit - x: " << pixelWithCharge.first << " y: " << pixelWithCharge.second << " With Charge: " << (*im).second << std::endl;
2355 
2356  hitSignal[chan] += (makeDigiSimLinks_ ? Amplitude((*im).second, &hit, hitIndex, tofBin, (*im).second)
2357  : Amplitude((*im).second, (*im).second));
2358  chargeBefore += (*im).second;
2359 
2360  if (pixelWithCharge.first < irow_min)
2361  irow_min = pixelWithCharge.first;
2362  if (pixelWithCharge.first > irow_max)
2363  irow_max = pixelWithCharge.first;
2364  if (pixelWithCharge.second < icol_min)
2365  icol_min = pixelWithCharge.second;
2366  if (pixelWithCharge.second > icol_max)
2367  icol_max = pixelWithCharge.second;
2368  }
2369 
2370  LocalPoint hitEntryPoint = hit.entryPoint();
2371 
2372  float trajectoryScaleToPosition = hitEntryPoint.z() / direction.z();
2373 
2374  if ((hitEntryPoint.z() > 0 && direction.z() < 0) || (hitEntryPoint.z() < 0 && direction.z() > 0)) {
2375  trajectoryScaleToPosition *= -1;
2376  }
2377 
2378  LocalPoint hitPosition = hitEntryPoint + trajectoryScaleToPosition * direction;
2379 
2380  MeasurementPoint hitPositionPixel = topol->measurementPosition(hit.localPosition());
2381  std::pair<int, int> hitPixel =
2382  std::pair<int, int>(int(floor(hitPositionPixel.x())), int(floor(hitPositionPixel.y())));
2383 
2384  MeasurementPoint originPixel = MeasurementPoint(hitPixel.first - THX + 0.5, hitPixel.second - THY + 0.5);
2385  LocalPoint origin = topol->localPosition(originPixel);
2386 
2387  MeasurementPoint hitEntryPointPixel = topol->measurementPosition(hit.entryPoint());
2388  MeasurementPoint hitExitPointPixel = topol->measurementPosition(hit.exitPoint());
2389  std::pair<int, int> entryPixel =
2390  std::pair<int, int>(int(floor(hitEntryPointPixel.x())), int(floor(hitEntryPointPixel.y())));
2391  std::pair<int, int> exitPixel =
2392  std::pair<int, int>(int(floor(hitExitPointPixel.x())), int(floor(hitExitPointPixel.y())));
2393 
2394  int hitcol_min, hitcol_max, hitrow_min, hitrow_max;
2395  if (entryPixel.first > exitPixel.first) {
2396  hitrow_min = exitPixel.first;
2397  hitrow_max = entryPixel.first;
2398  } else {
2399  hitrow_min = entryPixel.first;
2400  hitrow_max = exitPixel.first;
2401  }
2402 
2403  if (entryPixel.second > exitPixel.second) {
2404  hitcol_min = exitPixel.second;
2405  hitcol_max = entryPixel.second;
2406  } else {
2407  hitcol_min = entryPixel.second;
2408  hitcol_max = exitPixel.second;
2409  }
2410 
2411 #ifdef TP_DEBUG
2412  LocalPoint CMSSWhitPosition = hit.localPosition();
2413 
2414  LogDebug("Pixel Digitizer") << "\n"
2415  << "Particle ID is: " << hit.particleType() << "\n"
2416  << "Process type: " << hit.processType() << "\n"
2417  << "HitPosition:"
2418  << "\n"
2419  << "Hit entry x/y/z: " << hit.entryPoint().x() << " " << hit.entryPoint().y() << " "
2420  << hit.entryPoint().z() << " "
2421  << "Hit exit x/y/z: " << hit.exitPoint().x() << " " << hit.exitPoint().y() << " "
2422  << hit.exitPoint().z() << " "
2423 
2424  << "Pixel Pos - X: " << hitPositionPixel.x() << " Y: " << hitPositionPixel.y() << "\n"
2425  << "Cart.Cor. - X: " << CMSSWhitPosition.x() << " Y: " << CMSSWhitPosition.y() << "\n"
2426  << "Z=0 Pos - X: " << hitPosition.x() << " Y: " << hitPosition.y() << "\n"
2427 
2428  << "Origin of the template:"
2429  << "\n"
2430  << "Pixel Pos - X: " << originPixel.x() << " Y: " << originPixel.y() << "\n"
2431  << "Cart.Cor. - X: " << origin.x() << " Y: " << origin.y() << "\n"
2432  << "\n"
2433  << "Entry/Exit:"
2434  << "\n"
2435  << "Entry - X: " << hit.entryPoint().x() << " Y: " << hit.entryPoint().y()
2436  << " Z: " << hit.entryPoint().z() << "\n"
2437  << "Exit - X: " << hit.exitPoint().x() << " Y: " << hit.exitPoint().y()
2438  << " Z: " << hit.exitPoint().z() << "\n"
2439 
2440  << "Entry - X Pixel: " << hitEntryPointPixel.x() << " Y Pixel: " << hitEntryPointPixel.y()
2441  << "\n"
2442  << "Exit - X Pixel: " << hitExitPointPixel.x() << " Y Pixel: " << hitExitPointPixel.y()
2443  << "\n"
2444 
2445  << "row min: " << irow_min << " col min: " << icol_min << "\n";
2446 #endif
2447 
2448  if (!(irow_min <= hitrow_max && irow_max >= hitrow_min && icol_min <= hitcol_max && icol_max >= hitcol_min)) {
2449  // The clusters do not have an overlap, hence the hit is NOT reweighted
2450  return false;
2451  }
2452 
2453  float cmToMicrons = 10000.f;
2454 
2455  track[0] = (hitPosition.x() - origin.x()) * cmToMicrons;
2456  track[1] = (hitPosition.y() - origin.y()) * cmToMicrons;
2457  track[2] = 0.0f; //Middle of sensor is origin for Z-axis
2458  track[3] = direction.x();
2459  track[4] = direction.y();
2460  track[5] = direction.z();
2461 
2462  array_2d pixrewgt(boost::extents[TXSIZE][TYSIZE]);
2463 
2464  for (int row = 0; row < TXSIZE; ++row) {
2465  for (int col = 0; col < TYSIZE; ++col) {
2466  pixrewgt[row][col] = 0;
2467  }
2468  }
2469 
2470  for (int row = 0; row < TXSIZE; ++row) {
2471  xdouble[row] = topol->isItBigPixelInX(hitPixel.first + row - THX);
2472  }
2473 
2474  for (int col = 0; col < TYSIZE; ++col) {
2475  ydouble[col] = topol->isItBigPixelInY(hitPixel.second + col - THY);
2476  }
2477 
2478  for (int row = 0; row < TXSIZE; ++row) {
2479  for (int col = 0; col < TYSIZE; ++col) {
2480  //Fill charges into 21x13 Pixel Array with hitPixel in centre
2481  pixrewgt[row][col] =
2482  hitSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)];
2483  //std::cout << "Signal in " << hitPixel.first + row - THX << "/" << hitPixel.second + col - THY << " is " << hitSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)] << std::endl;
2484  }
2485  }
2486 
2487  if (PrintClusters) {
2488  std::cout << "Cluster before reweighting: " << std::endl;
2489  printCluster(pixrewgt);
2490  }
2491 
2492  int ierr;
2493  // for unirradiated: 2nd argument is IDden
2494  // for irradiated: 2nd argument is IDnum
2495  if (UseReweighting == true) {
2496  int ID1 = dbobject_num->getTemplateID(detID);
2497  int ID0 = dbobject_den->getTemplateID(detID);
2498 
2499  if (ID0 == ID1) {
2500  return false;
2501  }
2502  ierr = PixelTempRewgt2D(ID0, ID1, pixrewgt);
2503  } else {
2504  ierr = PixelTempRewgt2D(IDden, IDden, pixrewgt);
2505  }
2506  if (ierr != 0) {
2507 #ifdef TP_DEBUG
2508  LogDebug("PixelDigitizer ") << "Cluster Charge Reweighting did not work properly.";
2509 #endif
2510  return false;
2511  }
2512 
2513  if (PrintClusters) {
2514  std::cout << "Cluster after reweighting: " << std::endl;
2515  printCluster(pixrewgt);
2516  }
2517 
2518  for (int row = 0; row < TXSIZE; ++row) {
2519  for (int col = 0; col < TYSIZE; ++col) {
2520  float charge = 0;
2521  charge = pixrewgt[row][col];
2522  if ((hitPixel.first + row - THX) >= 0 && (hitPixel.first + row - THX) < topol->nrows() &&
2523  (hitPixel.second + col - THY) >= 0 && (hitPixel.second + col - THY) < topol->ncolumns() && charge > 0) {
2524  chargeAfter += charge;
2525  theSignal[PixelDigi::pixelToChannel(hitPixel.first + row - THX, hitPixel.second + col - THY)] +=
2526  (makeDigiSimLinks_ ? Amplitude(charge, &hit, hitIndex, tofBin, charge) : Amplitude(charge, charge));
2527  }
2528  }
2529  }
2530 
2531  if (chargeBefore != 0. && chargeAfter == 0.) {
2532  return false;
2533  }
2534 
2535  if (PrintClusters) {
2536  std::cout << std::endl;
2537  std::cout << "Charges (before->after): " << chargeBefore << " -> " << chargeAfter << std::endl;
2538  std::cout << "Charge loss: " << (1 - chargeAfter / chargeBefore) * 100 << " %" << std::endl << std::endl;
2539  }
2540 
2541  return true;
2542 }
#define LogDebug(id)
const SiPixel2DTemplateDBObject * dbobject_den
virtual int nrows() const =0
T y() const
Definition: PV2DBase.h:44
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
#define TXSIZE
T y() const
Definition: PV3DBase.h:60
virtual bool isItBigPixelInX(int ixbin) const =0
#define THX
const SiPixel2DTemplateDBObject * dbobject_num
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:71
U second(std::pair< T, U > const &p)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
Local3DPoint localPosition() const
Definition: PSimHit.h:52
void printCluster(array_2d &cluster)
T z() const
Definition: PV3DBase.h:61
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
virtual bool isItBigPixelInY(int iybin) const =0
#define THY
boost::multi_array< float, 2 > array_2d
std::map< int, Amplitude, std::less< int > > signal_map_type
#define TYSIZE
short getTemplateID(const uint32_t &detid) const
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
unsigned short processType() const
Definition: PSimHit.h:120
virtual int ncolumns() const =0
int particleType() const
Definition: PSimHit.h:89
col
Definition: cuy.py:1010
T x() const
Definition: PV2DBase.h:43
T x() const
Definition: PV3DBase.h:59
int PixelTempRewgt2D(int id_gen, int id_rewgt, array_2d &cluster)
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
void SiPixelDigitizerAlgorithm::induce_signal ( std::vector< PSimHit >::const_iterator  inputBegin,
std::vector< PSimHit >::const_iterator  inputEnd,
const PSimHit hit,
const size_t  hitIndex,
const unsigned int  tofBin,
const PixelGeomDetUnit pixdet,
const std::vector< SignalPoint > &  collection_points 
)
private

Definition at line 1349 of file SiPixelDigitizerAlgorithm.cc.

References _signal, LaserClient_cfi::Amplitude, calcQ(), officialStyle::chan, Topology::channel(), PixelDigi::channelToPixel(), ClusterWidth, GeomDet::geographicalId(), hitSignalReweight(), mps_fire::i, createfilelist::int, Topology::localPosition(), LogDebug, makeDigiSimLinks_, Topology::measurementPosition(), PixelTopology::ncolumns(), PixelTopology::nrows(), PixelTopology::pitch(), PixelDigi::pixelToChannel(), PSimHit::processType(), DetId::rawId(), VtxSmearedParameters_cfi::SigmaX, VtxSmearedParameters_cfi::SigmaY, PixelGeomDetUnit::specificTopology(), UseReweighting, x, PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), y, PV2DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by accumulateSimHits().

1355  {
1356  // X - Rows, Left-Right, 160, (1.6cm) for barrel
1357  // Y - Columns, Down-Up, 416, (6.4cm)
1358 
1359  const PixelTopology* topol = &pixdet->specificTopology();
1360  uint32_t detID = pixdet->geographicalId().rawId();
1361  signal_map_type& theSignal = _signal[detID];
1362 
1363 #ifdef TP_DEBUG
1364  LogDebug("Pixel Digitizer") << " enter induce_signal, " << topol->pitch().first << " " << topol->pitch().second; //OK
1365 #endif
1366 
1367  // local map to store pixels hit by 1 Hit.
1368  typedef std::map<int, float, std::less<int> > hit_map_type;
1369  hit_map_type hit_signal;
1370 
1371  // map to store pixel integrals in the x and in the y directions
1372  std::map<int, float, std::less<int> > x, y;
1373 
1374  // Assign signals to readout channels and store sorted by channel number
1375 
1376  // Iterate over collection points on the collection plane
1377  for (std::vector<SignalPoint>::const_iterator i = collection_points.begin(); i != collection_points.end(); ++i) {
1378  float CloudCenterX = i->position().x(); // Charge position in x
1379  float CloudCenterY = i->position().y(); // in y
1380  float SigmaX = i->sigma_x(); // Charge spread in x
1381  float SigmaY = i->sigma_y(); // in y
1382  float Charge = i->amplitude(); // Charge amplitude
1383 
1384  //if(SigmaX==0 || SigmaY==0) {
1385  //cout<<SigmaX<<" "<<SigmaY
1386  // << " cloud " << i->position().x() << " " << i->position().y() << " "
1387  // << i->sigma_x() << " " << i->sigma_y() << " " << i->amplitude()<<std::endl;
1388  //}
1389 
1390 #ifdef TP_DEBUG
1391  LogDebug("Pixel Digitizer") << " cloud " << i->position().x() << " " << i->position().y() << " " << i->sigma_x()
1392  << " " << i->sigma_y() << " " << i->amplitude();
1393 #endif
1394 
1395  // Find the maximum cloud spread in 2D plane , assume 3*sigma
1396  float CloudRight = CloudCenterX + ClusterWidth * SigmaX;
1397  float CloudLeft = CloudCenterX - ClusterWidth * SigmaX;
1398  float CloudUp = CloudCenterY + ClusterWidth * SigmaY;
1399  float CloudDown = CloudCenterY - ClusterWidth * SigmaY;
1400 
1401  // Define 2D cloud limit points
1402  LocalPoint PointRightUp = LocalPoint(CloudRight, CloudUp);
1403  LocalPoint PointLeftDown = LocalPoint(CloudLeft, CloudDown);
1404 
1405  // This points can be located outside the sensor area.
1406  // The conversion to measurement point does not check for that
1407  // so the returned pixel index might be wrong (outside range).
1408  // We rely on the limits check below to fix this.
1409  // But remember whatever we do here THE CHARGE OUTSIDE THE ACTIVE
1410  // PIXEL AREA IS LOST, it should not be collected.
1411 
1412  // Convert the 2D points to pixel indices
1413  MeasurementPoint mp = topol->measurementPosition(PointRightUp); //OK
1414 
1415  int IPixRightUpX = int(floor(mp.x()));
1416  int IPixRightUpY = int(floor(mp.y()));
1417 
1418 #ifdef TP_DEBUG
1419  LogDebug("Pixel Digitizer") << " right-up " << PointRightUp << " " << mp.x() << " " << mp.y() << " " << IPixRightUpX
1420  << " " << IPixRightUpY;
1421 #endif
1422 
1423  mp = topol->measurementPosition(PointLeftDown); //OK
1424 
1425  int IPixLeftDownX = int(floor(mp.x()));
1426  int IPixLeftDownY = int(floor(mp.y()));
1427 
1428 #ifdef TP_DEBUG
1429  LogDebug("Pixel Digitizer") << " left-down " << PointLeftDown << " " << mp.x() << " " << mp.y() << " "
1430  << IPixLeftDownX << " " << IPixLeftDownY;
1431 #endif
1432 
1433  // Check detector limits to correct for pixels outside range.
1434  int numColumns = topol->ncolumns(); // det module number of cols&rows
1435  int numRows = topol->nrows();
1436 
1437  IPixRightUpX = numRows > IPixRightUpX ? IPixRightUpX : numRows - 1;
1438  IPixRightUpY = numColumns > IPixRightUpY ? IPixRightUpY : numColumns - 1;
1439  IPixLeftDownX = 0 < IPixLeftDownX ? IPixLeftDownX : 0;
1440  IPixLeftDownY = 0 < IPixLeftDownY ? IPixLeftDownY : 0;
1441 
1442  x.clear(); // clear temporary integration array
1443  y.clear();
1444 
1445  // First integrate charge strips in x
1446  int ix; // TT for compatibility
1447  for (ix = IPixLeftDownX; ix <= IPixRightUpX; ix++) { // loop over x index
1448  float xUB, xLB, UpperBound, LowerBound;
1449 
1450  // Why is set to 0 if ix=0, does it meen that we accept charge
1451  // outside the sensor? CHeck How it was done in ORCA?
1452  //if(ix == 0) LowerBound = 0.;
1453  if (ix == 0 || SigmaX == 0.) // skip for surface segemnts
1454  LowerBound = 0.;
1455  else {
1456  mp = MeasurementPoint(float(ix), 0.0);
1457  xLB = topol->localPosition(mp).x();
1458  LowerBound = 1 - calcQ((xLB - CloudCenterX) / SigmaX);
1459  }
1460 
1461  if (ix == numRows - 1 || SigmaX == 0.)
1462  UpperBound = 1.;
1463  else {
1464  mp = MeasurementPoint(float(ix + 1), 0.0);
1465  xUB = topol->localPosition(mp).x();
1466  UpperBound = 1. - calcQ((xUB - CloudCenterX) / SigmaX);
1467  }
1468 
1469  float TotalIntegrationRange = UpperBound - LowerBound; // get strip
1470  x[ix] = TotalIntegrationRange; // save strip integral
1471  //if(SigmaX==0 || SigmaY==0)
1472  //cout<<TotalIntegrationRange<<" "<<ix<<std::endl;
1473  }
1474 
1475  // Now integrate strips in y
1476  int iy; // TT for compatibility
1477  for (iy = IPixLeftDownY; iy <= IPixRightUpY; iy++) { //loope over y ind
1478  float yUB, yLB, UpperBound, LowerBound;
1479 
1480  if (iy == 0 || SigmaY == 0.)
1481  LowerBound = 0.;
1482  else {
1483  mp = MeasurementPoint(0.0, float(iy));
1484  yLB = topol->localPosition(mp).y();
1485  LowerBound = 1. - calcQ((yLB - CloudCenterY) / SigmaY);
1486  }
1487 
1488  if (iy == numColumns - 1 || SigmaY == 0.)
1489  UpperBound = 1.;
1490  else {
1491  mp = MeasurementPoint(0.0, float(iy + 1));
1492  yUB = topol->localPosition(mp).y();
1493  UpperBound = 1. - calcQ((yUB - CloudCenterY) / SigmaY);
1494  }
1495 
1496  float TotalIntegrationRange = UpperBound - LowerBound;
1497  y[iy] = TotalIntegrationRange; // save strip integral
1498  //if(SigmaX==0 || SigmaY==0)
1499  //cout<<TotalIntegrationRange<<" "<<iy<<std::endl;
1500  }
1501 
1502  // Get the 2D charge integrals by folding x and y strips
1503  int chan;
1504  for (ix = IPixLeftDownX; ix <= IPixRightUpX; ix++) { // loop over x index
1505  for (iy = IPixLeftDownY; iy <= IPixRightUpY; iy++) { //loope over y ind
1506 
1507  float ChargeFraction = Charge * x[ix] * y[iy];
1508 
1509  if (ChargeFraction > 0.) {
1510  chan = PixelDigi::pixelToChannel(ix, iy); // Get index
1511  // Load the amplitude
1512  hit_signal[chan] += ChargeFraction;
1513  } // endif
1514 
1515 #ifdef TP_DEBUG
1516  mp = MeasurementPoint(float(ix), float(iy));
1517  LocalPoint lp = topol->localPosition(mp);
1518  chan = topol->channel(lp);
1519  LogDebug("Pixel Digitizer") << " pixel " << ix << " " << iy << " - "
1520  << " " << chan << " " << ChargeFraction << " " << mp.x() << " " << mp.y() << " "
1521  << lp.x() << " " << lp.y() << " " // givex edge position
1522  << chan; // edge belongs to previous ?
1523 #endif
1524 
1525  } // endfor iy
1526  } //endfor ix
1527 
1528  } // loop over charge distributions
1529 
1530  // Fill the global map with all hit pixels from this event
1531 
1532  bool reweighted = false;
1533  if (UseReweighting) {
1534  if (hit.processType() == 0) {
1535  reweighted = hitSignalReweight(hit, hit_signal, hitIndex, tofBin, topol, detID, theSignal, hit.processType());
1536  } else {
1537  // If it's not the primary particle, use the first hit in the collection as SimHit, which should be the corresponding primary.
1538  reweighted =
1539  hitSignalReweight((*inputBegin), hit_signal, hitIndex, tofBin, topol, detID, theSignal, hit.processType());
1540  }
1541  }
1542  if (!reweighted) {
1543  for (hit_map_type::const_iterator im = hit_signal.begin(); im != hit_signal.end(); ++im) {
1544  int chan = (*im).first;
1545  theSignal[chan] += (makeDigiSimLinks_ ? Amplitude((*im).second, &hit, hitIndex, tofBin, (*im).second)
1546  : Amplitude((*im).second, (*im).second));
1547 
1548 #ifdef TP_DEBUG
1549  std::pair<int, int> ip = PixelDigi::channelToPixel(chan);
1550  LogDebug("Pixel Digitizer") << " pixel " << ip.first << " " << ip.second << " " << theSignal[chan];
1551 #endif
1552  }
1553  }
1554 
1555 } // end induce_signal
#define LogDebug(id)
virtual int nrows() const =0
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T y() const
Definition: PV2DBase.h:44
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
T y() const
Definition: PV3DBase.h:60
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:71
virtual std::pair< float, float > pitch() const =0
U second(std::pair< T, U > const &p)
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
virtual int channel(const LocalPoint &p) const =0
std::map< int, Amplitude, std::less< int > > signal_map_type
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
unsigned short processType() const
Definition: PSimHit.h:120
virtual int ncolumns() const =0
T x() const
Definition: PV2DBase.h:43
T x() const
Definition: PV3DBase.h:59
bool hitSignalReweight(const PSimHit &hit, std::map< int, float, std::less< int > > &hit_signal, const size_t hitIndex, const unsigned int tofBin, const PixelTopology *topol, uint32_t detID, signal_map_type &theSignal, unsigned short int processType)
void SiPixelDigitizerAlgorithm::init ( const edm::EventSetup es)

Definition at line 115 of file SiPixelDigitizerAlgorithm.cc.

References mps_splice::entry, Exception, spr::find(), edm::EventSetup::get(), SiPixelSimParameters_cfi::KillBadFEDChannels, notFound, SiPixel2DTemplateDBObject::numOfTempl(), edm::ESHandle< T >::product(), SiPixelTemplate2D::pushfile(), MisalignedTracker_cfi::scenario, HLT_2018_cff::siPixelQualityLabel, AlCaHLTBitMon_QueryRunRegistry::string, HLT_2018_cff::track, HcalDetIdTransform::transform(), and HIPAlignmentAlgorithm_cfi::UseReweighting.

Referenced by PreMixingSiPixelWorker::initializeEvent().

115  {
116  if (use_ineff_from_db_) { // load gain calibration service fromdb...
117  theSiPixelGainCalibrationService_->setESObjects(es);
118  }
119  if (use_deadmodule_DB_) {
121  }
122  if (use_LorentzAngle_DB_) {
123  // Get Lorentz angle from DB record
125  }
126  //gets the map and geometry from the DB (to kill ROCs)
127  es.get<SiPixelFedCablingMapRcd>().get(map_);
129 
130  if (KillBadFEDChannels) {
134 
136  std::vector<std::string> allScenarios;
137 
138  std::transform(quality_map->begin(),
139  quality_map->end(),
140  std::back_inserter(allScenarios),
141  [](const PixelFEDChannelCollectionMap::value_type& pair) { return pair.first; });
142 
143  std::vector<std::string> allScenariosInProb;
144 
145  for (auto it = m_probabilities.begin(); it != m_probabilities.end(); ++it) {
146  //int PUbin = it->first;
147  for (const auto& entry : it->second) {
148  auto scenario = entry.first;
149  auto probability = entry.second;
150  if (probability != 0) {
151  if (std::find(allScenariosInProb.begin(), allScenariosInProb.end(), scenario) == allScenariosInProb.end()) {
152  allScenariosInProb.push_back(scenario);
153  }
154  } // if prob!=0
155  } // loop on the scenarios for that PU bin
156  } // loop on PU bins
157 
158  std::vector<std::string> notFound;
159  std::copy_if(allScenariosInProb.begin(),
160  allScenariosInProb.end(),
161  std::back_inserter(notFound),
162  [&allScenarios](const std::string& arg) {
163  return (std::find(allScenarios.begin(), allScenarios.end(), arg) == allScenarios.end());
164  });
165 
166  if (!notFound.empty()) {
167  for (const auto& entry : notFound) {
168  edm::LogError("SiPixelFEDChannelContainer")
169  << "The requested scenario: " << entry << " is not found in the map!!" << std::endl;
170  }
171  throw cms::Exception("SiPixelDigitizerAlgorithm") << "Found: " << notFound.size()
172  << " missing scenario(s) in SiPixelStatusScenariosRcd while "
173  "present in SiPixelStatusScenarioProbabilityRcd \n";
174  }
175  }
176 
177  // Read template files for charge reweighting
178  if (UseReweighting) {
180  es.get<SiPixel2DTemplateDBObjectRcd>().get("denominator", SiPixel2DTemp_den);
181  dbobject_den = SiPixel2DTemp_den.product();
182 
184  es.get<SiPixel2DTemplateDBObjectRcd>().get("numerator", SiPixel2DTemp_num);
185  dbobject_num = SiPixel2DTemp_num.product();
186 
187  int numOfTemplates = dbobject_den->numOfTempl() + dbobject_num->numOfTempl();
188  templateStores_.reserve(numOfTemplates);
191 
192  track.resize(6);
193  }
194 }
const SiPixel2DTemplateDBObject * dbobject_den
edm::ESHandle< SiPixelFedCablingMap > map_
std::map< unsigned int, probabilityVec > probabilityMap
const probabilityMap & getProbability_Map() const
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
edm::ESHandle< SiPixelQualityProbabilities > scenarioProbabilityHandle
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::ESHandle< TrackerGeometry > geom_
A arg
Definition: Factorize.h:36
edm::ESHandle< PixelFEDChannelCollectionMap > PixelFEDChannelCollectionMapHandle
const SiPixel2DTemplateDBObject * dbobject_num
const PixelFEDChannelCollectionMap * quality_map
edm::ESHandle< SiPixelLorentzAngle > SiPixelLorentzAngle_
edm::ESHandle< SiPixelQuality > SiPixelBadModule_
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore2D > &pixelTemp, std::string dir="")
static const GlobalPoint notFound(0, 0, 0)
std::vector< SiPixelTemplateStore2D > templateStores_
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
unsigned transform(const HcalDetId &id, unsigned transformCode)
void SiPixelDigitizerAlgorithm::init_DynIneffDB ( const edm::EventSetup es,
const unsigned int &  bunchspace 
)

Definition at line 606 of file SiPixelDigitizerAlgorithm.cc.

References AddPixelInefficiency, SiPixelDigitizerAlgorithm::PixelEfficiencies::FromConfig, geom_, edm::EventSetup::get(), SiPixelDigitizerAlgorithm::PixelEfficiencies::init_from_db(), pixelEfficiencies_, and SiPixelDynamicInefficiency_.

Referenced by PreMixingSiPixelWorker::put().

606  {
608  if (bunchspace == 50)
610  else
613  }
614 }
edm::ESHandle< TrackerGeometry > geom_
void init_from_db(const edm::ESHandle< TrackerGeometry > &, const edm::ESHandle< SiPixelDynamicInefficiency > &)
edm::ESHandle< SiPixelDynamicInefficiency > SiPixelDynamicInefficiency_
T get() const
Definition: EventSetup.h:73
std::map< int, SiPixelDigitizerAlgorithm::CalParameters, std::less< int > > SiPixelDigitizerAlgorithm::initCal ( ) const
private

Definition at line 359 of file SiPixelDigitizerAlgorithm.cc.

References calmap, beam_dqm_sourceclient-live_cfg::cerr, officialStyle::chan, PixelIndices::channelToPixelROC(), gather_cfg::cout, corrVsCorr::filename, mps_fire::i, recoMuon::in, mps_splice::line, LogDebug, Skims_PA_cff::name, AlCaHLTBitMon_ParallelJobs::p, SiPixelDigitizerAlgorithm::CalParameters::p0, SiPixelDigitizerAlgorithm::CalParameters::p1, SiPixelDigitizerAlgorithm::CalParameters::p2, SiPixelDigitizerAlgorithm::CalParameters::p3, fitWZ::par0, pfMETCorrectionType0_cfi::par1, pfMETCorrectionType0_cfi::par2, pfMETCorrectionType0_cfi::par3, PixelIndices::pixelToChannelROC(), and AlCaHLTBitMon_QueryRunRegistry::string.

359  {
360  using std::cerr;
361  using std::cout;
362  using std::endl;
363 
364  std::map<int, SiPixelDigitizerAlgorithm::CalParameters, std::less<int> > calmap;
365  // Prepare for the analog amplitude miss-calibration
366  LogDebug("PixelDigitizer ") << " miss-calibrate the pixel amplitude ";
367 
368  const bool ReadCalParameters = false;
369  if (ReadCalParameters) { // Read the calibration files from file
370  // read the calibration constants from a file (testing only)
371  std::ifstream in_file; // data file pointer
372  char filename[80] = "phCalibrationFit_C0.dat";
373 
374  in_file.open(filename, std::ios::in); // in C++
375  if (in_file.bad()) {
376  cout << " File not found " << endl;
377  return calmap; // signal error
378  }
379  cout << " file opened : " << filename << endl;
380 
381  char line[500];
382  for (int i = 0; i < 3; i++) {
383  in_file.getline(line, 500, '\n');
384  cout << line << endl;
385  }
386 
387  cout << " test map" << endl;
388 
389  float par0, par1, par2, par3;
390  int colid, rowid;
392  // Read MC tracks
393  for (int i = 0; i < (52 * 80); i++) { // loop over tracks
394  in_file >> par0 >> par1 >> par2 >> par3 >> name >> colid >> rowid;
395  if (in_file.bad()) { // check for errors
396  cerr << "Cannot read data file" << endl;
397  return calmap;
398  }
399  if (in_file.eof() != 0) {
400  cerr << in_file.eof() << " " << in_file.gcount() << " " << in_file.fail() << " " << in_file.good()
401  << " end of file " << endl;
402  return calmap;
403  }
404 
405  //cout << " line " << i << " " <<par0<<" "<<par1<<" "<<par2<<" "<<par3<<" "
406  // <<colid<<" "<<rowid<<endl;
407 
408  CalParameters onePix;
409  onePix.p0 = par0;
410  onePix.p1 = par1;
411  onePix.p2 = par2;
412  onePix.p3 = par3;
413 
414  // Convert ROC pixel index to channel
415  int chan = PixelIndices::pixelToChannelROC(rowid, colid);
416  calmap.insert(std::pair<int, CalParameters>(chan, onePix));
417 
418  // Testing the index conversion, can be skipped
419  std::pair<int, int> p = PixelIndices::channelToPixelROC(chan);
420  if (rowid != p.first)
421  cout << " wrong channel row " << rowid << " " << p.first << endl;
422  if (colid != p.second)
423  cout << " wrong channel col " << colid << " " << p.second << endl;
424 
425  } // pixel loop in a ROC
426 
427  cout << " map size " << calmap.size() << " max " << calmap.max_size() << " " << calmap.empty() << endl;
428 
429  // cout << " map size " << calmap.size() << endl;
430  // map<int,CalParameters,std::less<int> >::iterator ix,it;
431  // map<int,CalParameters,std::less<int> >::const_iterator ip;
432  // for (ix = calmap.begin(); ix != calmap.end(); ++ix) {
433  // int i = (*ix).first;
434  // std::pair<int,int> p = channelToPixelROC(i);
435  // it = calmap.find(i);
436  // CalParameters y = (*it).second;
437  // CalParameters z = (*ix).second;
438  // cout << i <<" "<<p.first<<" "<<p.second<<" "<<y.p0<<" "<<z.p0<<" "<<calmap[i].p0<<endl;
439 
440  // //int dummy=0;
441  // //cin>>dummy;
442  // }
443 
444  } // end if readparameters
445  return calmap;
446 } // end initCal()
#define LogDebug(id)
static std::pair< int, int > channelToPixelROC(const int chan)
Definition: PixelIndices.h:236
static int pixelToChannelROC(const int rowROC, const int colROC)
Definition: PixelIndices.h:233
par0
Definition: fitWZ.py:52
const std::map< int, CalParameters, std::less< int > > calmap
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
void SiPixelDigitizerAlgorithm::initializeEvent ( )
inline
bool SiPixelDigitizerAlgorithm::killBadFEDChannels ( ) const

Definition at line 896 of file SiPixelDigitizerAlgorithm.cc.

References KillBadFEDChannels.

Referenced by PreMixingSiPixelWorker::put().

void SiPixelDigitizerAlgorithm::make_digis ( float  thePixelThresholdInE,
uint32_t  detID,
const PixelGeomDetUnit pixdet,
std::vector< PixelDigi > &  digis,
std::vector< PixelDigiSimLink > &  simlinks,
const TrackerTopology tTopo 
) const
private

Definition at line 1560 of file SiPixelDigitizerAlgorithm.cc.

References _signal, ecalMGPA::adc(), officialStyle::chan, PixelDigi::channelToPixel(), cuy::col, doMissCalibrate, f, newFWLiteAna::found, HLT_2018_cff::fraction, mps_fire::i, info(), createfilelist::int, LogDebug, makeDigiSimLinks_, min(), missCalibrate(), mcMuonSeeds_cfi::SimTrack, theAdcFullScale, theElectronPerADC, theThresholdInE_BPix, theThresholdInE_BPix_L1, theThresholdInE_BPix_L2, and theThresholdInE_FPix.

Referenced by digitize().

1565  {
1566 #ifdef TP_DEBUG
1567  LogDebug("Pixel Digitizer") << " make digis "
1568  << " "
1569  << " pixel threshold FPix" << theThresholdInE_FPix << " "
1570  << " pixel threshold BPix" << theThresholdInE_BPix << " "
1571  << " pixel threshold BPix Layer1" << theThresholdInE_BPix_L1 << " "
1572  << " pixel threshold BPix Layer2" << theThresholdInE_BPix_L2 << " "
1573  << " List pixels passing threshold ";
1574 #endif
1575 
1576  // Loop over hit pixels
1577 
1578  signalMaps::const_iterator it = _signal.find(detID);
1579  if (it == _signal.end()) {
1580  return;
1581  }
1582 
1583  const signal_map_type& theSignal = (*it).second;
1584 
1585  // unsigned long is enough to store SimTrack id and EncodedEventId
1586  using TrackEventId = std::pair<decltype(SimTrack().trackId()), decltype(EncodedEventId().rawId())>;
1587  std::map<TrackEventId, float> simi; // re-used
1588 
1589  for (signal_map_const_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
1590  float signalInElectrons = (*i).second; // signal in electrons
1591 
1592  // Do the miss calibration for calibration studies only.
1593  //if(doMissCalibrate) signalInElectrons = missCalibrate(signalInElectrons)
1594 
1595  // Do only for pixels above threshold
1596 
1597  if (signalInElectrons >= thePixelThresholdInE &&
1598  signalInElectrons > 0.) { // check threshold, always reject killed (0-charge) digis
1599 
1600  int chan = (*i).first; // channel number
1601  std::pair<int, int> ip = PixelDigi::channelToPixel(chan);
1602  int adc = 0; // ADC count as integer
1603 
1604  // Do the miss calibration for calibration studies only.
1605  if (doMissCalibrate) {
1606  int row = ip.first; // X in row
1607  int col = ip.second; // Y is in col
1608  adc = int(missCalibrate(detID, tTopo, pixdet, col, row, signalInElectrons)); //full misscalib.
1609  } else { // Just do a simple electron->adc conversion
1610  adc = int(signalInElectrons / theElectronPerADC); // calibrate gain
1611  }
1612  adc = std::min(adc, theAdcFullScale); // Check maximum value
1613 #ifdef TP_DEBUG
1614  LogDebug("Pixel Digitizer") << (*i).first << " " << (*i).second << " " << signalInElectrons << " " << adc
1615  << ip.first << " " << ip.second;
1616 #endif
1617 
1618  // Load digis
1619  digis.emplace_back(ip.first, ip.second, adc);
1620 
1621  if (makeDigiSimLinks_ && !(*i).second.hitInfos().empty()) {
1622  //digilink
1623  unsigned int il = 0;
1624  for (const auto& info : (*i).second.hitInfos()) {
1625  // note: according to C++ standard operator[] does
1626  // value-initializiation, which for float means initial value of 0
1627  simi[std::make_pair(info.trackId(), info.eventId().rawId())] += (*i).second.individualampl()[il];
1628  il++;
1629  }
1630 
1631  //sum the contribution of the same trackid
1632  for (const auto& info : (*i).second.hitInfos()) {
1633  // skip if track already processed
1634  auto found = simi.find(std::make_pair(info.trackId(), info.eventId().rawId()));
1635  if (found == simi.end())
1636  continue;
1637 
1638  float sum_samechannel = found->second;
1639  float fraction = sum_samechannel / (*i).second;
1640  if (fraction > 1.f)
1641  fraction = 1.f;
1642 
1643  // Approximation: pick hitIndex and tofBin only from the first SimHit
1644  simlinks.emplace_back((*i).first, info.trackId(), info.hitIndex(), info.tofBin(), info.eventId(), fraction);
1645  simi.erase(found);
1646  }
1647  simi.clear(); // although should be empty already
1648  }
1649  }
1650  }
1651 }
#define LogDebug(id)
signal_map_type::const_iterator signal_map_const_iterator
static const TGPicture * info(bool iBackgroundIsBlack)
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
double f[11][100]
T min(T a, T b)
Definition: MathUtil.h:58
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
std::map< int, Amplitude, std::less< int > > signal_map_type
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
float missCalibrate(uint32_t detID, const TrackerTopology *tTopo, const PixelGeomDetUnit *pixdet, int col, int row, float amp) const
col
Definition: cuy.py:1010
float SiPixelDigitizerAlgorithm::missCalibrate ( uint32_t  detID,
const TrackerTopology tTopo,
const PixelGeomDetUnit pixdet,
int  col,
int  row,
float  amp 
) const
private

Definition at line 2038 of file SiPixelDigitizerAlgorithm.cc.

References BPix_p0, BPix_p1, BPix_p2, BPix_p3, electronsPerVCAL, electronsPerVCAL_L1, electronsPerVCAL_L1_Offset, electronsPerVCAL_Offset, Exception, FPix_p0, FPix_p1, FPix_p2, FPix_p3, GeomDetType::isBarrel(), GeomDetType::isTrackerPixel(), p1, p2, p3, TrackerTopology::pxbLayer(), DetId::subdetId(), and PixelGeomDetUnit::type().

Referenced by make_digis().

2043  {
2044  // Central values
2045  //const float p0=0.00352, p1=0.868, p2=112., p3=113.; // pix(0,0,0)
2046  // const float p0=0.00382, p1=0.886, p2=112.7, p3=113.0; // average roc=0
2047  //const float p0=0.00492, p1=1.998, p2=90.6, p3=134.1; // average roc=6
2048  // Smeared (rms)
2049  //const float s0=0.00020, s1=0.051, s2=5.4, s3=4.4; // average roc=0
2050  //const float s0=0.00015, s1=0.043, s2=3.2, s3=3.1; // col average roc=0
2051 
2052  // Make 2 sets of parameters for Fpix and BPIx:
2053 
2054  float p0 = 0.0f;
2055  float p1 = 0.0f;
2056  float p2 = 0.0f;
2057  float p3 = 0.0f;
2058 
2059  if (pixdet->type().isTrackerPixel() && pixdet->type().isBarrel()) { // barrel layers
2060  p0 = BPix_p0;
2061  p1 = BPix_p1;
2062  p2 = BPix_p2;
2063  p3 = BPix_p3;
2064  } else if (pixdet->type().isTrackerPixel()) { // forward disks
2065  p0 = FPix_p0;
2066  p1 = FPix_p1;
2067  p2 = FPix_p2;
2068  p3 = FPix_p3;
2069  } else {
2070  throw cms::Exception("NotAPixelGeomDetUnit") << "Not a pixel geomdet unit" << detID;
2071  }
2072 
2073  float newAmp = 0.f; //Modified signal
2074 
2075  // Convert electrons to VCAL units
2076  float signal = (signalInElectrons - electronsPerVCAL_Offset) / electronsPerVCAL;
2077 
2078  // New gains/offsets are needed for phase1 L1
2079  int layer = 0;
2080  if (DetId(detID).subdetId() == 1)
2081  layer = tTopo->pxbLayer(detID);
2082  if (layer == 1)
2083  signal = (signalInElectrons - electronsPerVCAL_L1_Offset) / electronsPerVCAL_L1;
2084 
2085  // Simulate the analog response with fixed parametrization
2086  newAmp = p3 + p2 * tanh(p0 * signal - p1);
2087 
2088  // Use the pixel-by-pixel calibrations
2089  //transform to ROC index coordinates
2090  //int chipIndex=0, colROC=0, rowROC=0;
2091  //std::unique_ptr<PixelIndices> pIndexConverter(new PixelIndices(numColumns,numRows));
2092  //pIndexConverter->transformToROC(col,row,chipIndex,colROC,rowROC);
2093 
2094  // Use calibration from a file
2095  //int chanROC = PixelIndices::pixelToChannelROC(rowROC,colROC); // use ROC coordinates
2096  //float pp0=0, pp1=0,pp2=0,pp3=0;
2097  //map<int,CalParameters,std::less<int> >::const_iterator it=calmap.find(chanROC);
2098  //CalParameters y = (*it).second;
2099  //pp0 = y.p0;
2100  //pp1 = y.p1;
2101  //pp2 = y.p2;
2102  //pp3 = y.p3;
2103 
2104  //
2105  // Use random smearing
2106  // Randomize the pixel response
2107  //float pp0 = RandGaussQ::shoot(p0,s0);
2108  //float pp1 = RandGaussQ::shoot(p1,s1);
2109  //float pp2 = RandGaussQ::shoot(p2,s2);
2110  //float pp3 = RandGaussQ::shoot(p3,s3);
2111 
2112  //newAmp = pp3 + pp2 * tanh(pp0*signal - pp1); // Final signal
2113 
2114  //cout<<" misscalibrate "<<col<<" "<<row<<" "<<chipIndex<<" "<<colROC<<" "
2115  // <<rowROC<<" "<<signalInElectrons<<" "<<signal<<" "<<newAmp<<" "
2116  // <<(signalInElectrons/theElectronPerADC)<<std::endl;
2117 
2118  return newAmp;
2119 }
const GeomDetType & type() const override
bool isBarrel() const
Definition: GeomDetType.cc:9
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
bool isTrackerPixel() const
Definition: GeomDetType.cc:15
double p2[4]
Definition: TauolaWrapper.h:90
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:17
double p1[4]
Definition: TauolaWrapper.h:89
double p3[4]
Definition: TauolaWrapper.h:91
void SiPixelDigitizerAlgorithm::module_killing_conf ( uint32_t  detID)
private

Definition at line 2219 of file SiPixelDigitizerAlgorithm.cc.

References _signal, PixelDigi::channelToPixel(), DeadModules, mps_fire::i, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by digitize().

2219  {
2220  bool isbad = false;
2221 
2222  Parameters::const_iterator itDeadModules = DeadModules.begin();
2223 
2224  int detid = detID;
2225  for (; itDeadModules != DeadModules.end(); ++itDeadModules) {
2226  int Dead_detID = itDeadModules->getParameter<int>("Dead_detID");
2227  if (detid == Dead_detID) {
2228  isbad = true;
2229  break;
2230  }
2231  }
2232 
2233  if (!isbad)
2234  return;
2235 
2236  signal_map_type& theSignal = _signal[detID];
2237 
2238  std::string Module = itDeadModules->getParameter<std::string>("Module");
2239 
2240  if (Module == "whole") {
2241  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
2242  i->second.set(0.); // reset amplitude
2243  }
2244  }
2245 
2246  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
2247  std::pair<int, int> ip = PixelDigi::channelToPixel(i->first); //get pixel pos
2248 
2249  if (Module == "tbmA" && ip.first >= 80 && ip.first <= 159) {
2250  i->second.set(0.);
2251  }
2252 
2253  if (Module == "tbmB" && ip.first <= 79) {
2254  i->second.set(0.);
2255  }
2256  }
2257 }
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
signal_map_type::iterator signal_map_iterator
std::map< int, Amplitude, std::less< int > > signal_map_type
void SiPixelDigitizerAlgorithm::module_killing_DB ( uint32_t  detID)
private

Definition at line 2259 of file SiPixelDigitizerAlgorithm.cc.

References _signal, funct::abs(), PixelDigi::channelToPixel(), SiPixelQuality::disabledModuleType::errorType, SiPixelFedCablingMap::findItem(), SiPixelQuality::getBadComponentList(), mps_fire::i, triggerObjects_cff::id, sipixelobjects::PixelROC::idInDetUnit(), SiPixelQuality::IsRocBad(), dqmiolumiharvest::j, DTRecHitClients_cfi::local, map_, castor_dqm_sourceclient_file_cfg::path, SiPixelFedCablingMap::pathToDetUnit(), edm::ESHandle< T >::product(), SiPixelBadModule_, and sipixelobjects::PixelROC::toGlobal().

Referenced by digitize().

2259  {
2260  // Not SLHC safe for now
2261 
2262  bool isbad = false;
2263 
2264  std::vector<SiPixelQuality::disabledModuleType> disabledModules = SiPixelBadModule_->getBadComponentList();
2265 
2267 
2268  for (size_t id = 0; id < disabledModules.size(); id++) {
2269  if (detID == disabledModules[id].DetID) {
2270  isbad = true;
2271  badmodule = disabledModules[id];
2272  break;
2273  }
2274  }
2275 
2276  if (!isbad)
2277  return;
2278 
2279  signal_map_type& theSignal = _signal[detID];
2280 
2281  //std::cout<<"Hit in: "<< detID <<" errorType "<< badmodule.errorType<<" BadRocs="<<std::hex<<SiPixelBadModule_->getBadRocs(detID)<<dec<<" "<<std::endl;
2282  if (badmodule.errorType == 0) { // this is a whole dead module.
2283 
2284  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
2285  i->second.set(0.); // reset amplitude
2286  }
2287  } else { // all other module types: half-modules and single ROCs.
2288  // Get Bad ROC position:
2289  //follow the example of getBadRocPositions in CondFormats/SiPixelObjects/src/SiPixelQuality.cc
2290  std::vector<GlobalPixel> badrocpositions(0);
2291  for (unsigned int j = 0; j < 16; j++) {
2292  if (SiPixelBadModule_->IsRocBad(detID, j) == true) {
2293  std::vector<CablingPathToDetUnit> path = map_.product()->pathToDetUnit(detID);
2294  typedef std::vector<CablingPathToDetUnit>::const_iterator IT;
2295  for (IT it = path.begin(); it != path.end(); ++it) {
2296  const PixelROC* myroc = map_.product()->findItem(*it);
2297  if (myroc->idInDetUnit() == j) {
2298  LocalPixel::RocRowCol local = {39, 25}; //corresponding to center of ROC row, col
2299  GlobalPixel global = myroc->toGlobal(LocalPixel(local));
2300  badrocpositions.push_back(global);
2301  break;
2302  }
2303  }
2304  }
2305  } // end of getBadRocPositions
2306 
2307  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
2308  std::pair<int, int> ip = PixelDigi::channelToPixel(i->first); //get pixel pos
2309 
2310  for (std::vector<GlobalPixel>::const_iterator it = badrocpositions.begin(); it != badrocpositions.end(); ++it) {
2311  if (it->row >= 80 && ip.first >= 80) {
2312  if ((std::abs(ip.second - it->col) < 26)) {
2313  i->second.set(0.);
2314  } else if (it->row == 120 && ip.second - it->col == 26) {
2315  i->second.set(0.);
2316  } else if (it->row == 119 && it->col - ip.second == 26) {
2317  i->second.set(0.);
2318  }
2319  } else if (it->row < 80 && ip.first < 80) {
2320  if ((std::abs(ip.second - it->col) < 26)) {
2321  i->second.set(0.);
2322  } else if (it->row == 40 && ip.second - it->col == 26) {
2323  i->second.set(0.);
2324  } else if (it->row == 39 && it->col - ip.second == 26) {
2325  i->second.set(0.);
2326  }
2327  }
2328  }
2329  }
2330  }
2331 }
edm::ESHandle< SiPixelFedCablingMap > map_
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
identify pixel inside single ROC
Definition: LocalPixel.h:7
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::vector< disabledModuleType > getBadComponentList() const
std::vector< LinkConnSpec >::const_iterator IT
signal_map_type::iterator signal_map_iterator
std::map< int, Amplitude, std::less< int > > signal_map_type
edm::ESHandle< SiPixelQuality > SiPixelBadModule_
row and collumn in ROC representation
Definition: LocalPixel.h:13
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const final
T const * product() const
Definition: ESHandle.h:86
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:55
float SiPixelDigitizerAlgorithm::pixel_aging ( const PixelAging aging,
const PixelGeomDetUnit pixdet,
const TrackerTopology tTopo 
) const
private

Definition at line 1986 of file SiPixelDigitizerAlgorithm.cc.

References SiPixelDigitizerAlgorithm::PixelAging::FPixIndex, GeomDet::geographicalId(), TrackerTopology::layer(), LogDebug, GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2OTB, GeomDetEnumerators::P2OTEC, GeomDetEnumerators::P2PXEC, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, DetId::rawId(), GeomDet::subDetector(), and SiPixelDigitizerAlgorithm::PixelAging::thePixelPseudoRadDamage.

Referenced by drift().

1988  {
1989  uint32_t detID = pixdet->geographicalId().rawId();
1990 
1991  // Predefined damage parameter (no aging)
1992  float pseudoRadDamage = 0.0f;
1993 
1994  // setup the chip indices conversion
1996  pixdet->subDetector() == GeomDetEnumerators::SubDetector::P1PXB) { // barrel layers
1997  int layerIndex = tTopo->layer(detID);
1998 
1999  pseudoRadDamage = aging.thePixelPseudoRadDamage[layerIndex - 1];
2000 
2001  // std::cout << "pixel_aging: " << std::endl;
2002  // std::cout << "Subid " << Subid << " layerIndex " << layerIndex << " ladder " << tTopo->pxbLadder(detID) << " module " << tTopo->pxbModule(detID) << std::endl;
2003 
2006  pixdet->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) { // forward disks
2007  unsigned int diskIndex =
2008  tTopo->layer(detID) + aging.FPixIndex; // Use diskIndex-1 later to stay consistent with BPix
2009 
2010  pseudoRadDamage = aging.thePixelPseudoRadDamage[diskIndex - 1];
2011 
2012  // std::cout << "pixel_aging: " << std::endl;
2013  // std::cout << "Subid " << Subid << " diskIndex " << diskIndex << std::endl;
2014  } else if (pixdet->subDetector() == GeomDetEnumerators::SubDetector::P2OTB ||
2016  // if phase 2 OT hardcoded value as it has always been
2017  pseudoRadDamage = 0.f;
2018  } // if barrel/forward
2019 
2020  // std::cout << " pseudoRadDamage " << pseudoRadDamage << std::endl;
2021  // std::cout << " end pixel_aging " << std::endl;
2022 
2023  return pseudoRadDamage;
2024 #ifdef TP_DEBUG
2025  LogDebug("Pixel Digitizer") << " enter pixel_aging " << pseudoRadDamage;
2026 #endif
2027 }
#define LogDebug(id)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
unsigned int layer(const DetId &id) const
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38
Definition: aging.py:1
void SiPixelDigitizerAlgorithm::pixel_inefficiency ( const PixelEfficiencies eff,
const PixelGeomDetUnit pixdet,
const TrackerTopology tTopo,
CLHEP::HepRandomEngine *  engine 
)
private

Definition at line 1759 of file SiPixelDigitizerAlgorithm.cc.

References _signal, officialStyle::chan, PixelDigi::channelToPixel(), SiPixelDigitizerAlgorithm::PixelEfficiencies::ChipGeomFactors, sipixelobjects::GlobalPixel::col, cuy::col, SiPixelDigitizerAlgorithm::PixelEfficiencies::ColGeomFactors, mps_check::columns, SiPixelFedCablingMap::findItem(), SiPixelDigitizerAlgorithm::PixelEfficiencies::FPixIndex, SiPixelDigitizerAlgorithm::PixelEfficiencies::FromConfig, GeomDet::geographicalId(), mps_fire::i, sipixelobjects::PixelROC::idInDetUnit(), SiPixelDigitizerAlgorithm::PixelEfficiencies::iPU, PixelTopology::isItBigPixelInX(), PixelTopology::isItBigPixelInY(), pixelClusterTagInfos_cfi::isPhase1, KillBadFEDChannels, PVValHelper::ladder, TrackerTopology::layer(), DTRecHitClients_cfi::local, LogDebug, map_, PixelTopology::ncolumns(), PixelTopology::nrows(), NumberOfBarrelLayers, AlCaHLTBitMon_ParallelJobs::p, GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2OTB, GeomDetEnumerators::P2OTEC, GeomDetEnumerators::P2PXEC, castor_dqm_sourceclient_file_cfg::path, SiPixelFedCablingMap::pathToDetUnit(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelFEDChannelCollection_, SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelGeomFactors, SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelGeomFactorsROCBigPixels, SiPixelDigitizerAlgorithm::PixelEfficiencies::PixelGeomFactorsROCStdPixels, edm::ESHandle< T >::product(), SiPixelDigitizerAlgorithm::PixelEfficiencies::pu_scale, TrackerTopology::pxbLadder(), TrackerTopology::pxbModule(), TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), rand(), DetId::rawId(), sipixelobjects::GlobalPixel::row, PixelGeomDetUnit::specificTopology(), GeomDet::subDetector(), SiPixelDigitizerAlgorithm::PixelEfficiencies::theInnerEfficiency_FPix, SiPixelDigitizerAlgorithm::PixelEfficiencies::theLadderEfficiency_BPix, SiPixelDigitizerAlgorithm::PixelEfficiencies::theModuleEfficiency_BPix, SiPixelDigitizerAlgorithm::PixelEfficiencies::theOuterEfficiency_FPix, SiPixelDigitizerAlgorithm::PixelEfficiencies::thePixelChipEfficiency, SiPixelDigitizerAlgorithm::PixelEfficiencies::thePixelColEfficiency, SiPixelDigitizerAlgorithm::PixelEfficiencies::thePixelEfficiency, and sipixelobjects::PixelROC::toGlobal().

Referenced by digitize().

1762  {
1763  uint32_t detID = pixdet->geographicalId().rawId();
1764  signal_map_type& theSignal = _signal[detID];
1765  const PixelTopology* topol = &pixdet->specificTopology();
1766  int numColumns = topol->ncolumns(); // det module number of cols&rows
1767  int numRows = topol->nrows();
1770  // Predefined efficiencies
1771  double pixelEfficiency = 1.0;
1772  double columnEfficiency = 1.0;
1773  double chipEfficiency = 1.0;
1774  std::vector<double> pixelEfficiencyROCStdPixels(16, 1);
1775  std::vector<double> pixelEfficiencyROCBigPixels(16, 1);
1776 
1777  auto pIndexConverter = PixelIndices(numColumns, numRows);
1778 
1779  std::vector<int> badRocsFromFEDChannels(16, 0);
1780  if (eff.PixelFEDChannelCollection_ != nullptr) {
1781  PixelFEDChannelCollection::const_iterator it = eff.PixelFEDChannelCollection_->find(detID);
1782 
1783  if (it != eff.PixelFEDChannelCollection_->end()) {
1784  const std::vector<CablingPathToDetUnit>& path = map_->pathToDetUnit(detID);
1785  for (const auto& ch : *it) {
1786  for (unsigned int i_roc = ch.roc_first; i_roc <= ch.roc_last; ++i_roc) {
1787  for (const auto p : path) {
1788  const PixelROC* myroc = map_.product()->findItem(p);
1789  if (myroc->idInDetUnit() == static_cast<unsigned int>(i_roc)) {
1790  LocalPixel::RocRowCol local = {39, 25}; //corresponding to center of ROC row,col
1791  GlobalPixel global = myroc->toGlobal(LocalPixel(local));
1792  int chipIndex(0), colROC(0), rowROC(0);
1793  pIndexConverter.transformToROC(global.col, global.row, chipIndex, colROC, rowROC);
1794  badRocsFromFEDChannels.at(chipIndex) = 1;
1795  }
1796  }
1797  }
1798  } // loop over channels
1799  } // detID in PixelFEDChannelCollection_
1800  } // has PixelFEDChannelCollection_
1801 
1802  if (eff.FromConfig) {
1803  // setup the chip indices conversion
1805  pixdet->subDetector() == GeomDetEnumerators::SubDetector::P1PXB) { // barrel layers
1806  int layerIndex = tTopo->layer(detID);
1807  pixelEfficiency = eff.thePixelEfficiency[layerIndex - 1];
1808  columnEfficiency = eff.thePixelColEfficiency[layerIndex - 1];
1809  chipEfficiency = eff.thePixelChipEfficiency[layerIndex - 1];
1810  //std::cout <<"Using BPix columnEfficiency = "<<columnEfficiency<< " for layer = "<<layerIndex <<"\n";
1811  // This should never happen, but only check if it is not an upgrade geometry
1812  if (NumberOfBarrelLayers == 3) {
1813  if (numColumns > 416)
1814  LogWarning("Pixel Geometry") << " wrong columns in barrel " << numColumns;
1815  if (numRows > 160)
1816  LogWarning("Pixel Geometry") << " wrong rows in barrel " << numRows;
1817 
1818  int ladder = tTopo->pxbLadder(detID);
1819  int module = tTopo->pxbModule(detID);
1820  if (module <= 4)
1821  module = 5 - module;
1822  else
1823  module -= 4;
1824 
1825  columnEfficiency *= eff.theLadderEfficiency_BPix[layerIndex - 1][ladder - 1] *
1826  eff.theModuleEfficiency_BPix[layerIndex - 1][module - 1] * eff.pu_scale[layerIndex - 1];
1827  }
1830  pixdet->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) { // forward disks
1831 
1832  unsigned int diskIndex =
1833  tTopo->layer(detID) + eff.FPixIndex; // Use diskIndex-1 later to stay consistent with BPix
1834  unsigned int panelIndex = tTopo->pxfPanel(detID);
1835  unsigned int moduleIndex = tTopo->pxfModule(detID);
1836  //if (eff.FPixIndex>diskIndex-1){throw cms::Exception("Configuration") <<"SiPixelDigitizer is using the wrong efficiency value. index = "
1837  // <<diskIndex-1<<" , MinIndex = "<<eff.FPixIndex<<" ... "<<tTopo->pxfDisk(detID);}
1838  pixelEfficiency = eff.thePixelEfficiency[diskIndex - 1];
1839  columnEfficiency = eff.thePixelColEfficiency[diskIndex - 1];
1840  chipEfficiency = eff.thePixelChipEfficiency[diskIndex - 1];
1841  //std::cout <<"Using FPix columnEfficiency = "<<columnEfficiency<<" for Disk = "<< tTopo->pxfDisk(detID)<<"\n";
1842  // Sometimes the forward pixels have wrong size,
1843  // this crashes the index conversion, so exit, but only check if it is not an upgrade geometry
1844  if (NumberOfBarrelLayers ==
1845  3) { // whether it is the present or the phase 1 detector can be checked using GeomDetEnumerators::SubDetector
1846  if (numColumns > 260 || numRows > 160) {
1847  if (numColumns > 260)
1848  LogWarning("Pixel Geometry") << " wrong columns in endcaps " << numColumns;
1849  if (numRows > 160)
1850  LogWarning("Pixel Geometry") << " wrong rows in endcaps " << numRows;
1851  return;
1852  }
1853  if ((panelIndex == 1 && (moduleIndex == 1 || moduleIndex == 2)) ||
1854  (panelIndex == 2 && moduleIndex == 1)) { //inner modules
1855  columnEfficiency *= eff.theInnerEfficiency_FPix[diskIndex - 1] * eff.pu_scale[3];
1856  } else { //outer modules
1857  columnEfficiency *= eff.theOuterEfficiency_FPix[diskIndex - 1] * eff.pu_scale[4];
1858  }
1859  } // current detector, forward
1860  } else if (pixdet->subDetector() == GeomDetEnumerators::SubDetector::P2OTB ||
1862  // If phase 2 outer tracker, hardcoded values as they have been so far
1863  pixelEfficiency = 0.999;
1864  columnEfficiency = 0.999;
1865  chipEfficiency = 0.999;
1866  } // if barrel/forward
1867  } else { // Load precomputed factors from Database
1868  pixelEfficiency = eff.PixelGeomFactors.at(detID);
1869  columnEfficiency = eff.ColGeomFactors.at(detID) * eff.pu_scale[eff.iPU.at(detID)];
1870  chipEfficiency = eff.ChipGeomFactors.at(detID);
1871  if (isPhase1) {
1872  for (unsigned int i_roc = 0; i_roc < eff.PixelGeomFactorsROCStdPixels.at(detID).size(); ++i_roc) {
1873  pixelEfficiencyROCStdPixels[i_roc] = eff.PixelGeomFactorsROCStdPixels.at(detID).at(i_roc);
1874  pixelEfficiencyROCBigPixels[i_roc] = eff.PixelGeomFactorsROCBigPixels.at(detID).at(i_roc);
1875  }
1876  } // is Phase 1
1877  }
1878 
1879 #ifdef TP_DEBUG
1880  LogDebug("Pixel Digitizer") << " enter pixel_inefficiency " << pixelEfficiency << " " << columnEfficiency << " "
1881  << chipEfficiency;
1882 #endif
1883 
1884  // Initilize the index converter
1885  //PixelIndices indexConverter(numColumns,numRows);
1886 
1887  int chipIndex = 0;
1888  int rowROC = 0;
1889  int colROC = 0;
1890  std::map<int, int, std::less<int> > chips, columns, pixelStd, pixelBig;
1891  std::map<int, int, std::less<int> >::iterator iter;
1892 
1893  // Find out the number of columns and rocs hits
1894  // Loop over hit pixels, amplitude in electrons, channel = coded row,col
1895  for (signal_map_const_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
1896  int chan = i->first;
1897  std::pair<int, int> ip = PixelDigi::channelToPixel(chan);
1898  int row = ip.first; // X in row
1899  int col = ip.second; // Y is in col
1900  //transform to ROC index coordinates
1901  pIndexConverter.transformToROC(col, row, chipIndex, colROC, rowROC);
1902  int dColInChip = pIndexConverter.DColumn(colROC); // get ROC dcol from ROC col
1903  //dcol in mod
1904  int dColInDet = pIndexConverter.DColumnInModule(dColInChip, chipIndex);
1905 
1906  chips[chipIndex]++;
1907  columns[dColInDet]++;
1908  if (isPhase1) {
1909  if (topol->isItBigPixelInX(row) || topol->isItBigPixelInY(col))
1910  pixelBig[chipIndex]++;
1911  else
1912  pixelStd[chipIndex]++;
1913  }
1914  }
1915 
1916  // Delete some ROC hits.
1917  for (iter = chips.begin(); iter != chips.end(); iter++) {
1918  //float rand = RandFlat::shoot();
1919  float rand = CLHEP::RandFlat::shoot(engine);
1920  if (rand > chipEfficiency)
1921  chips[iter->first] = 0;
1922  }
1923 
1924  // Delete some Dcol hits.
1925  for (iter = columns.begin(); iter != columns.end(); iter++) {
1926  //float rand = RandFlat::shoot();
1927  float rand = CLHEP::RandFlat::shoot(engine);
1928  if (rand > columnEfficiency)
1929  columns[iter->first] = 0;
1930  }
1931 
1932  // Delete some pixel hits based on DCDC issue damage.
1933  if (isPhase1) {
1934  for (iter = pixelStd.begin(); iter != pixelStd.end(); iter++) {
1935  float rand = CLHEP::RandFlat::shoot(engine);
1936  if (rand > pixelEfficiencyROCStdPixels[iter->first])
1937  pixelStd[iter->first] = 0;
1938  }
1939 
1940  for (iter = pixelBig.begin(); iter != pixelBig.end(); iter++) {
1941  float rand = CLHEP::RandFlat::shoot(engine);
1942  if (rand > pixelEfficiencyROCBigPixels[iter->first])
1943  pixelBig[iter->first] = 0;
1944  }
1945  }
1946 
1947  // Now loop again over pixels to kill some of them.
1948  // Loop over hit pixels, amplitude in electrons, channel = coded row,col
1949  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
1950  // int chan = i->first;
1951  std::pair<int, int> ip = PixelDigi::channelToPixel(i->first); //get pixel pos
1952  int row = ip.first; // X in row
1953  int col = ip.second; // Y is in col
1954  //transform to ROC index coordinates
1955  pIndexConverter.transformToROC(col, row, chipIndex, colROC, rowROC);
1956  int dColInChip = pIndexConverter.DColumn(colROC); //get ROC dcol from ROC col
1957  //dcol in mod
1958  int dColInDet = pIndexConverter.DColumnInModule(dColInChip, chipIndex);
1959 
1960  //float rand = RandFlat::shoot();
1961  float rand = CLHEP::RandFlat::shoot(engine);
1962  if (chips[chipIndex] == 0 || columns[dColInDet] == 0 || rand > pixelEfficiency ||
1963  (pixelStd.count(chipIndex) && pixelStd[chipIndex] == 0) ||
1964  (pixelBig.count(chipIndex) && pixelBig[chipIndex] == 0)) {
1965  // make pixel amplitude =0, pixel will be lost at clusterization
1966  i->second.set(0.); // reset amplitude,
1967  } // end if
1968  if (isPhase1) {
1969  if ((pixelStd.count(chipIndex) && pixelStd[chipIndex] == 0) ||
1970  (pixelBig.count(chipIndex) && pixelBig[chipIndex] == 0) || (badRocsFromFEDChannels.at(chipIndex) == 1)) {
1971  //============================================================
1972  // make pixel amplitude =0, pixel will be lost at clusterization
1973  i->second.set(0.); // reset amplitude,
1974  } // end if
1975  } // is Phase 1
1976  if (KillBadFEDChannels && badRocsFromFEDChannels.at(chipIndex) == 1) {
1977  i->second.set(0.);
1978  }
1979  } // end pixel loop
1980 } // end pixel_indefficiency
#define LogDebug(id)
virtual int nrows() const =0
signal_map_type::const_iterator signal_map_const_iterator
edm::ESHandle< SiPixelFedCablingMap > map_
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
unsigned int pxbLadder(const DetId &id) const
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
unsigned int pxbModule(const DetId &id) const
virtual bool isItBigPixelInX(int ixbin) const =0
identify pixel inside single ROC
Definition: LocalPixel.h:7
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
unsigned int idInDetUnit() const
id of this ROC in DetUnit etermined by token path
Definition: PixelROC.h:37
virtual bool isItBigPixelInY(int iybin) const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
signal_map_type::iterator signal_map_iterator
unsigned int pxfModule(const DetId &id) const
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::map< int, Amplitude, std::less< int > > signal_map_type
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
row and collumn in ROC representation
Definition: LocalPixel.h:13
const sipixelobjects::PixelROC * findItem(const sipixelobjects::CablingPathToDetUnit &path) const final
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
unsigned int layer(const DetId &id) const
std::vector< sipixelobjects::CablingPathToDetUnit > pathToDetUnit(uint32_t rawDetId) const final
virtual int ncolumns() const =0
col
Definition: cuy.py:1010
Signal rand(Signal arg)
Definition: vlib.cc:379
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38
T const * product() const
Definition: ESHandle.h:86
Definition: vlib.h:198
unsigned int pxfPanel(const DetId &id) const
GlobalPixel toGlobal(const LocalPixel &loc) const
Definition: PixelROC.h:55
void SiPixelDigitizerAlgorithm::pixel_inefficiency_db ( uint32_t  detID)
private

Definition at line 2199 of file SiPixelDigitizerAlgorithm.cc.

References _signal, PixelDigi::channelToPixel(), cuy::col, mps_fire::i, and theSiPixelGainCalibrationService_.

Referenced by digitize().

2199  {
2200  signal_map_type& theSignal = _signal[detID];
2201 
2202  // Loop over hit pixels, amplitude in electrons, channel = coded row,col
2203  for (signal_map_iterator i = theSignal.begin(); i != theSignal.end(); ++i) {
2204  // int chan = i->first;
2205  std::pair<int, int> ip = PixelDigi::channelToPixel(i->first); //get pixel pos
2206  int row = ip.first; // X in row
2207  int col = ip.second; // Y is in col
2208  //transform to ROC index coordinates
2209  if (theSiPixelGainCalibrationService_->isDead(detID, col, row)) {
2210  // std::cout << "now in isdead check, row " << detID << " " << col << "," << row << std::std::endl;
2211  // make pixel amplitude =0, pixel will be lost at clusterization
2212  i->second.set(0.); // reset amplitude,
2213  } // end if
2214  } // end pixel loop
2215 } // end pixel_indefficiency
const std::unique_ptr< SiPixelGainCalibrationOfflineSimService > theSiPixelGainCalibrationService_
static std::pair< int, int > channelToPixel(int ch)
Definition: PixelDigi.h:65
signal_map_type::iterator signal_map_iterator
std::map< int, Amplitude, std::less< int > > signal_map_type
col
Definition: cuy.py:1010
int SiPixelDigitizerAlgorithm::PixelTempRewgt2D ( int  id_in,
int  id_rewgt,
array_2d cluster 
)
private

Reweight CMSSW clusters to look like clusters corresponding to Pixelav Templates.

Parameters
id_in- (input) identifier of the template corresponding to the input events
id_rewgt- (input) identifier of the template corresponding to the output events
cluster- (input/output) boost multi_array container of 7x21 array of pixel signals, origin of local coords (0,0) at center of pixel cluster[3][10]. returns 0 if everything is OK, 1 if angles are outside template coverage (cluster is probably still usable, > 1 if something is wrong (no reweight done).

Definition at line 2553 of file SiPixelDigitizerAlgorithm.cc.

References funct::abs(), BXM2, BYM2, gather_cfg::cout, f, SiPixelTemplate2D::getid(), mps_fire::i, createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, cmsLHEtoEOSManager::l, LogDebug, printCluster(), PrintTemplates, SiPixelTemplate2D::s50(), summarizeEdmComparisonLogfiles::success, templ2D, track, TXSIZE, TYSIZE, xdouble, xsize, SiPixelTemplate2D::xsize(), SiPixelTemplate2D::xytemp(), ydouble, ysize, and SiPixelTemplate2D::ysize().

Referenced by hitSignalReweight().

2553  {
2554  // Local variables
2555  int i, j, k, l, kclose;
2556  int nclusx, nclusy, success;
2557  float xsize, ysize, q50i, q100i, q50r, q10r, q100r, xhit2D, yhit2D, qclust, dist2, dmin2;
2558  float xy_in[BXM2][BYM2], xy_rewgt[BXM2][BYM2], xy_clust[TXSIZE][TYSIZE];
2559  int denx_clust[TXSIZE][TYSIZE], deny_clust[TXSIZE][TYSIZE];
2560  int goodWeightsUsed, nearbyWeightsUsed, noWeightsUsed;
2561  float cotalpha, cotbeta;
2562  // success = 0 is returned if everthing is OK
2563  success = 0;
2564 
2565  // Copy the array to remember original charges
2566  array_2d clust(cluster);
2567 
2568  // Take the pixel dimensions from the 2D template
2569  templ2D.getid(id_in);
2570  xsize = templ2D.xsize();
2571  ysize = templ2D.ysize();
2572 
2573  // Calculate the track angles
2574 
2575  if (std::abs(track[5]) > 0.f) {
2576  cotalpha = track[3] / track[5]; //if track[5] (direction in z) is 0 the hit is not processed by re-weighting
2577  cotbeta = track[4] / track[5];
2578  } else {
2579  LogDebug("Pixel Digitizer") << "Reweighting angle is not good!" << std::endl;
2580  return 9; //returned value here indicates that no reweighting was done in this case
2581  }
2582 
2583  // The 2-D templates are defined on a shifted coordinate system wrt the 1D templates
2584  if (ydouble[0]) {
2585  yhit2D = track[1] - cotbeta * track[2] + ysize;
2586  } else {
2587  yhit2D = track[1] - cotbeta * track[2] + 0.5f * ysize;
2588  }
2589  if (xdouble[0]) {
2590  xhit2D = track[0] - cotalpha * track[2] + xsize;
2591  } else {
2592  xhit2D = track[0] - cotalpha * track[2] + 0.5f * xsize;
2593  }
2594 
2595  // Zero the input and output templates
2596  for (i = 0; i < BYM2; ++i) {
2597  for (j = 0; j < BXM2; ++j) {
2598  xy_in[j][i] = 0.f;
2599  xy_rewgt[j][i] = 0.f;
2600  }
2601  }
2602 
2603  // Next, interpolate the CMSSW template needed to analyze this cluster
2604 
2605  if (!templ2D.xytemp(id_in, cotalpha, cotbeta, xhit2D, yhit2D, ydouble, xdouble, xy_in)) {
2606  success = 1;
2607  }
2608  if (success != 0) {
2609 #ifdef TP_DEBUG
2610  LogDebug("Pixel Digitizer") << "No matching template found" << std::endl;
2611 #endif
2612  return 2;
2613  }
2614 
2615  if (PrintTemplates) {
2616  std::cout << "Template unirrad: " << std::endl;
2617  printCluster(xy_in);
2618  }
2619 
2620  q50i = templ2D.s50();
2621  //q50i = 0;
2622  q100i = 2.f * q50i;
2623 
2624  // Check that the cluster container is a 13x21 matrix
2625 
2626  if (cluster.num_dimensions() != 2) {
2627  LogWarning("Pixel Digitizer") << "Cluster is not 2-dimensional. Return." << std::endl;
2628  return 3;
2629  }
2630  nclusx = (int)cluster.shape()[0];
2631  nclusy = (int)cluster.shape()[1];
2632  if (nclusx != TXSIZE || xdouble.size() != TXSIZE) {
2633  LogWarning("Pixel Digitizer") << "Sizes in x do not match: nclusx=" << nclusx << " xdoubleSize=" << xdouble.size()
2634  << " TXSIZE=" << TXSIZE << ". Return." << std::endl;
2635  return 4;
2636  }
2637  if (nclusy != TYSIZE || ydouble.size() != TYSIZE) {
2638  LogWarning("Pixel Digitizer") << "Sizes in y do not match. Return." << std::endl;
2639  return 5;
2640  }
2641 
2642  // Sum initial charge in the cluster
2643 
2644  qclust = 0.f;
2645  for (i = 0; i < TYSIZE; ++i) {
2646  for (j = 0; j < TXSIZE; ++j) {
2647  xy_clust[j][i] = 0.f;
2648  denx_clust[j][i] = 0;
2649  deny_clust[j][i] = 0;
2650  if (cluster[j][i] > q100i) {
2651  qclust += cluster[j][i];
2652  }
2653  }
2654  }
2655 
2656  // Next, interpolate the physical output template needed to reweight
2657 
2658  if (!templ2D.xytemp(id_rewgt, cotalpha, cotbeta, xhit2D, yhit2D, ydouble, xdouble, xy_rewgt)) {
2659  success = 1;
2660  }
2661 
2662  if (PrintTemplates) {
2663  std::cout << "Template irrad: " << std::endl;
2664  printCluster(xy_rewgt);
2665  }
2666 
2667  q50r = templ2D.s50();
2668  q100r = 2.f * q50r;
2669  q10r = 0.2f * q50r;
2670 
2671  // Find all non-zero denominator pixels in the input template and generate "inside" weights
2672 
2673  int ntpix = 0;
2674  int ncpix = 0;
2675  std::vector<int> ytclust;
2676  std::vector<int> xtclust;
2677  std::vector<int> ycclust;
2678  std::vector<int> xcclust;
2679  qclust = 0.f;
2680  for (i = 0; i < TYSIZE; ++i) {
2681  for (j = 0; j < TXSIZE; ++j) {
2682  if (xy_in[j + 1][i + 1] > q100i) {
2683  ++ntpix;
2684  ytclust.push_back(i);
2685  xtclust.push_back(j);
2686  xy_clust[j][i] = xy_rewgt[j + 1][i + 1] / xy_in[j + 1][i + 1];
2687  denx_clust[j][i] = j;
2688  deny_clust[j][i] = i;
2689  }
2690  }
2691  }
2692 
2693  // Find all non-zero numerator pixels not matched to denominator in the output template and generate "inside" weights
2694 
2695  for (i = 0; i < TYSIZE; ++i) {
2696  for (j = 0; j < TXSIZE; ++j) {
2697  if (xy_rewgt[j + 1][i + 1] > q10r && xy_clust[j][i] == 0.f && ntpix > 0) {
2698  // Search for nearest denominator pixel
2699  dmin2 = 10000.f;
2700  kclose = 0;
2701  for (k = 0; k < ntpix; ++k) {
2702  dist2 = (i - ytclust[k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[k]) * (j - xtclust[k]);
2703  if (dist2 < dmin2) {
2704  dmin2 = dist2;
2705  kclose = k;
2706  }
2707  }
2708  xy_clust[j][i] = xy_rewgt[j + 1][i + 1] / xy_in[xtclust[kclose] + 1][ytclust[kclose] + 1];
2709  denx_clust[j][i] = xtclust[kclose];
2710  deny_clust[j][i] = ytclust[kclose];
2711  }
2712  }
2713  }
2714 
2715  if (PrintTemplates) {
2716  std::cout << "Weights:" << std::endl;
2717  printCluster(xy_clust);
2718  }
2719 
2720  // Do the reweighting
2721  goodWeightsUsed = 0;
2722  nearbyWeightsUsed = 0;
2723  noWeightsUsed = 0;
2724 
2725  for (i = 0; i < TYSIZE; ++i) {
2726  for (j = 0; j < TXSIZE; ++j) {
2727  if (xy_clust[j][i] > 0.f) {
2728  cluster[j][i] = xy_clust[j][i] * clust[denx_clust[j][i]][deny_clust[j][i]];
2729  if (cluster[j][i] > q100r) {
2730  qclust += cluster[j][i];
2731  }
2732  if (cluster[j][i] > 0) {
2733  goodWeightsUsed++;
2734  }
2735  } else {
2736  if (clust[j][i] > 0.f) {
2737  ++ncpix;
2738  ycclust.push_back(i);
2739  xcclust.push_back(j);
2740  }
2741  }
2742  }
2743  }
2744 
2745  // Now reweight pixels outside of template footprint using closest weights
2746 
2747  if (ncpix > 0) {
2748  for (l = 0; l < ncpix; ++l) {
2749  i = ycclust[l];
2750  j = xcclust[l];
2751  dmin2 = 10000.f;
2752  kclose = 0;
2753  for (k = 0; k < ntpix; ++k) {
2754  dist2 = (i - ytclust[k]) * (i - ytclust[k]) + 0.44444f * (j - xtclust[k]) * (j - xtclust[k]);
2755  if (dist2 < dmin2) {
2756  dmin2 = dist2;
2757  kclose = k;
2758  }
2759  }
2760  if (dmin2 < 5.f) {
2761  nearbyWeightsUsed++;
2762  cluster[j][i] *= xy_clust[xtclust[kclose]][ytclust[kclose]];
2763  if (cluster[j][i] > q100r) {
2764  qclust += cluster[j][i];
2765  }
2766  } else {
2767  noWeightsUsed++;
2768  cluster[j][i] = 0.f;
2769  }
2770  }
2771  }
2772 
2773  return success;
2774 } // PixelTempRewgt2D
#define LogDebug(id)
float xsize()
pixel x-size (microns)
bool xytemp(float xhit, float yhit, bool ydouble[21+2], bool xdouble[13+2], float template2d[13+2][21+2], bool dervatives, float dpdx2d[2][13+2][21+2], float &QTemplate)
#define TXSIZE
const Int_t ysize
float s50()
1/2 of the pixel threshold signal in adc units
#define BXM2
void printCluster(array_2d &cluster)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define BYM2
double f[11][100]
boost::multi_array< float, 2 > array_2d
#define TYSIZE
float ysize()
pixel y-size (microns)
const Int_t xsize
void SiPixelDigitizerAlgorithm::primary_ionization ( const PSimHit hit,
std::vector< EnergyDepositUnit > &  ionization_points,
CLHEP::HepRandomEngine *  engine 
) const
private

Definition at line 1099 of file SiPixelDigitizerAlgorithm.cc.

References simKBmtfDigis_cfi::eLoss, HCALHighEnergyHPDFilter_cfi::energy, PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::exitPoint(), dqmMemoryStats::float, fluctuateCharge, fluctuateEloss(), GeVperElectron, mps_fire::i, createfilelist::int, LogDebug, PV3DBase< T, PVType, FrameType >::mag(), PSimHit::pabs(), PSimHit::particleType(), point, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by accumulateSimHits().

1101  {
1102  // Straight line approximation for trajectory inside active media
1103 
1104  const float SegmentLength = 0.0010; //10microns in cm
1105  float energy;
1106 
1107  // Get the 3D segment direction vector
1108  LocalVector direction = hit.exitPoint() - hit.entryPoint();
1109 
1110  float eLoss = hit.energyLoss(); // Eloss in GeV
1111  float length = direction.mag(); // Track length in Silicon
1112 
1113  int NumberOfSegments = int(length / SegmentLength); // Number of segments
1114  if (NumberOfSegments < 1)
1115  NumberOfSegments = 1;
1116 
1117 #ifdef TP_DEBUG
1118  LogDebug("Pixel Digitizer") << " enter primary_ionzation " << NumberOfSegments
1119  << " shift = " << (hit.exitPoint().x() - hit.entryPoint().x()) << " "
1120  << (hit.exitPoint().y() - hit.entryPoint().y()) << " "
1121  << (hit.exitPoint().z() - hit.entryPoint().z()) << " " << hit.particleType() << " "
1122  << hit.pabs();
1123 #endif
1124 
1125  float* elossVector = new float[NumberOfSegments]; // Eloss vector
1126 
1127  if (fluctuateCharge) {
1128  //MP DA RIMUOVERE ASSOLUTAMENTE
1129  int pid = hit.particleType();
1130  //int pid=211; // assume it is a pion
1131 
1132  float momentum = hit.pabs();
1133  // Generate fluctuated charge points
1134  fluctuateEloss(pid, momentum, eLoss, length, NumberOfSegments, elossVector, engine);
1135  }
1136 
1137  ionization_points.resize(NumberOfSegments); // set size
1138 
1139  // loop over segments
1140  for (int i = 0; i != NumberOfSegments; i++) {
1141  // Divide the segment into equal length subsegments
1142  Local3DPoint point = hit.entryPoint() + float((i + 0.5) / NumberOfSegments) * direction;
1143 
1144  if (fluctuateCharge)
1145  energy = elossVector[i] / GeVperElectron; // Convert charge to elec.
1146  else
1147  energy = hit.energyLoss() / GeVperElectron / float(NumberOfSegments);
1148 
1149  EnergyDepositUnit edu(energy, point); //define position,energy point
1150  ionization_points[i] = edu; // save
1151 
1152 #ifdef TP_DEBUG
1153  LogDebug("Pixel Digitizer") << i << " " << ionization_points[i].x() << " " << ionization_points[i].y() << " "
1154  << ionization_points[i].z() << " " << ionization_points[i].energy();
1155 #endif
1156 
1157  } // end for loop
1158 
1159  delete[] elossVector;
1160 }
#define LogDebug(id)
T y() const
Definition: PV3DBase.h:60
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:46
T mag() const
Definition: PV3DBase.h:64
T z() const
Definition: PV3DBase.h:61
float pabs() const
fast and more accurate access to momentumAtEntry().mag()
Definition: PSimHit.h:67
void fluctuateEloss(int particleId, float momentum, float eloss, float length, int NumberOfSegments, float elossVector[], CLHEP::HepRandomEngine *) const
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:79
int particleType() const
Definition: PSimHit.h:89
T x() const
Definition: PV3DBase.h:59
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:43
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
void SiPixelDigitizerAlgorithm::printCluster ( array_2d cluster)
private

Definition at line 2776 of file SiPixelDigitizerAlgorithm.cc.

References cuy::col, gather_cfg::cout, alignBH_cfg::fixed, TXSIZE, and TYSIZE.

Referenced by hitSignalReweight(), and PixelTempRewgt2D().

2776  {
2777  for (int col = 0; col < TYSIZE; ++col) {
2778  for (int row = 0; row < TXSIZE; ++row) {
2779  std::cout << std::setw(10) << std::setprecision(0) << std::fixed;
2780  std::cout << cluster[row][col];
2781  }
2782  std::cout << std::endl;
2783  }
2784  std::cout.copyfmt(std::ios(nullptr));
2785 }
#define TXSIZE
#define TYSIZE
col
Definition: cuy.py:1010
void SiPixelDigitizerAlgorithm::printCluster ( float  arr[13+2][21+2])
private

Definition at line 2787 of file SiPixelDigitizerAlgorithm.cc.

References BXM2, BYM2, cuy::col, gather_cfg::cout, and alignBH_cfg::fixed.

2787  {
2788  for (int col = 0; col < BYM2; ++col) {
2789  for (int row = 0; row < BXM2; ++row) {
2790  std::cout << std::setw(10) << std::setprecision(0) << std::fixed;
2791  std::cout << arr[row][col];
2792  }
2793  std::cout << std::endl;
2794  }
2795  std::cout.copyfmt(std::ios(nullptr));
2796 }
#define BXM2
#define BYM2
col
Definition: cuy.py:1010
void SiPixelDigitizerAlgorithm::printCluster ( float  arr[13][21])
private

Definition at line 2798 of file SiPixelDigitizerAlgorithm.cc.

References cuy::col, gather_cfg::cout, alignBH_cfg::fixed, TXSIZE, and TYSIZE.

2798  {
2799  for (int col = 0; col < TYSIZE; ++col) {
2800  for (int row = 0; row < TXSIZE; ++row) {
2801  std::cout << std::setw(10) << std::fixed;
2802  std::cout << arr[row][col];
2803  }
2804  std::cout << std::endl;
2805  }
2806  std::cout.copyfmt(std::ios(nullptr));
2807 }
#define TXSIZE
#define TYSIZE
col
Definition: cuy.py:1010
void SiPixelDigitizerAlgorithm::setSimAccumulator ( const std::map< uint32_t, std::map< int, int > > &  signalMap)

Definition at line 990 of file SiPixelDigitizerAlgorithm.cc.

References _signal, officialStyle::chan, and theElectronPerADC.

Referenced by PreMixingSiPixelWorker::put().

990  {
991  for (const auto& det : signalMap) {
992  auto& theSignal = _signal[det.first];
993  for (const auto& chan : det.second) {
994  theSignal[chan.first].set(chan.second *
995  theElectronPerADC); // will get divided again by theElectronPerAdc in digitize...
996  }
997  }
998 }
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...

Member Data Documentation

signalMaps SiPixelDigitizerAlgorithm::_signal
private
const bool SiPixelDigitizerAlgorithm::addChargeVCALSmearing
private

Definition at line 381 of file SiPixelDigitizerAlgorithm.h.

Referenced by add_noise().

const bool SiPixelDigitizerAlgorithm::addNoise
private

Definition at line 380 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const bool SiPixelDigitizerAlgorithm::addNoisyPixels
private

Definition at line 382 of file SiPixelDigitizerAlgorithm.h.

Referenced by add_noise().

const bool SiPixelDigitizerAlgorithm::AddPixelAging
private

Definition at line 396 of file SiPixelDigitizerAlgorithm.h.

Referenced by drift().

const bool SiPixelDigitizerAlgorithm::AddPixelInefficiency
private
const bool SiPixelDigitizerAlgorithm::addThresholdSmearing
private

Definition at line 388 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const bool SiPixelDigitizerAlgorithm::alpha2Order
private

Definition at line 335 of file SiPixelDigitizerAlgorithm.h.

Referenced by drift(), and DriftDirection().

const float SiPixelDigitizerAlgorithm::BPix_p0
private

Definition at line 374 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::BPix_p1
private

Definition at line 375 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::BPix_p2
private

Definition at line 376 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::BPix_p3
private

Definition at line 377 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const std::map<int, CalParameters, std::less<int> > SiPixelDigitizerAlgorithm::calmap
private

Definition at line 414 of file SiPixelDigitizerAlgorithm.h.

Referenced by initCal().

const float SiPixelDigitizerAlgorithm::ClusterWidth
private

Definition at line 338 of file SiPixelDigitizerAlgorithm.h.

Referenced by induce_signal().

const SiPixel2DTemplateDBObject* SiPixelDigitizerAlgorithm::dbobject_den
private

Definition at line 323 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight().

const SiPixel2DTemplateDBObject* SiPixelDigitizerAlgorithm::dbobject_num
private

Definition at line 324 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight().

const Parameters SiPixelDigitizerAlgorithm::DeadModules
private

Definition at line 312 of file SiPixelDigitizerAlgorithm.h.

Referenced by module_killing_conf().

const float SiPixelDigitizerAlgorithm::Dist300
private

Definition at line 334 of file SiPixelDigitizerAlgorithm.h.

Referenced by drift().

const bool SiPixelDigitizerAlgorithm::doMissCalibrate
private

Definition at line 391 of file SiPixelDigitizerAlgorithm.h.

Referenced by make_digis().

const float SiPixelDigitizerAlgorithm::electronsPerVCAL
private

Definition at line 360 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::electronsPerVCAL_L1
private

Definition at line 362 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::electronsPerVCAL_L1_Offset
private

Definition at line 363 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::electronsPerVCAL_Offset
private

Definition at line 361 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const std::unique_ptr<SiG4UniversalFluctuation> SiPixelDigitizerAlgorithm::fluctuate
private

Definition at line 410 of file SiPixelDigitizerAlgorithm.h.

Referenced by fluctuateEloss().

const bool SiPixelDigitizerAlgorithm::fluctuateCharge
private

Definition at line 383 of file SiPixelDigitizerAlgorithm.h.

Referenced by primary_ionization().

const float SiPixelDigitizerAlgorithm::FPix_p0
private

Definition at line 370 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::FPix_p1
private

Definition at line 371 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::FPix_p2
private

Definition at line 372 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

const float SiPixelDigitizerAlgorithm::FPix_p3
private

Definition at line 373 of file SiPixelDigitizerAlgorithm.h.

Referenced by missCalibrate().

edm::ESHandle<TrackerGeometry> SiPixelDigitizerAlgorithm::geom_
private

Definition at line 103 of file SiPixelDigitizerAlgorithm.h.

Referenced by init_DynIneffDB().

const float SiPixelDigitizerAlgorithm::GeVperElectron
private

Definition at line 330 of file SiPixelDigitizerAlgorithm.h.

Referenced by primary_ionization().

int SiPixelDigitizerAlgorithm::IDden
private

Definition at line 319 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight().

int SiPixelDigitizerAlgorithm::IDnum
private

Definition at line 319 of file SiPixelDigitizerAlgorithm.h.

const bool SiPixelDigitizerAlgorithm::KillBadFEDChannels
private

Definition at line 387 of file SiPixelDigitizerAlgorithm.h.

Referenced by killBadFEDChannels(), and pixel_inefficiency().

const bool SiPixelDigitizerAlgorithm::makeDigiSimLinks_
private

Definition at line 305 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight(), induce_signal(), and make_digis().

edm::ESHandle<SiPixelFedCablingMap> SiPixelDigitizerAlgorithm::map_
private

Definition at line 102 of file SiPixelDigitizerAlgorithm.h.

Referenced by module_killing_DB(), and pixel_inefficiency().

const int SiPixelDigitizerAlgorithm::NumberOfBarrelLayers
private
const int SiPixelDigitizerAlgorithm::NumberOfEndcapDisks
private
const PixelAging SiPixelDigitizerAlgorithm::pixelAging_
private

Definition at line 483 of file SiPixelDigitizerAlgorithm.h.

Referenced by drift().

PixelEfficiencies SiPixelDigitizerAlgorithm::pixelEfficiencies_
private
edm::ESHandle<PixelFEDChannelCollectionMap> SiPixelDigitizerAlgorithm::PixelFEDChannelCollectionMapHandle
private

Definition at line 110 of file SiPixelDigitizerAlgorithm.h.

const bool SiPixelDigitizerAlgorithm::PrintClusters
private

Definition at line 398 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight().

const bool SiPixelDigitizerAlgorithm::PrintTemplates
private

Definition at line 399 of file SiPixelDigitizerAlgorithm.h.

Referenced by PixelTempRewgt2D().

const PixelFEDChannelCollectionMap* SiPixelDigitizerAlgorithm::quality_map

Definition at line 91 of file SiPixelDigitizerAlgorithm.h.

Referenced by chooseScenario().

edm::ESHandle<SiPixelQualityProbabilities> SiPixelDigitizerAlgorithm::scenarioProbabilityHandle
private

Definition at line 109 of file SiPixelDigitizerAlgorithm.h.

Referenced by chooseScenario().

const float SiPixelDigitizerAlgorithm::Sigma0
private

Definition at line 333 of file SiPixelDigitizerAlgorithm.h.

Referenced by drift().

edm::ESHandle<SiPixelQuality> SiPixelDigitizerAlgorithm::SiPixelBadModule_
private

Definition at line 99 of file SiPixelDigitizerAlgorithm.h.

Referenced by module_killing_DB().

edm::ESHandle<SiPixelDynamicInefficiency> SiPixelDigitizerAlgorithm::SiPixelDynamicInefficiency_
private

Definition at line 106 of file SiPixelDigitizerAlgorithm.h.

Referenced by init_DynIneffDB().

edm::ESHandle<SiPixelLorentzAngle> SiPixelDigitizerAlgorithm::SiPixelLorentzAngle_
private

Definition at line 95 of file SiPixelDigitizerAlgorithm.h.

Referenced by DriftDirection().

std::string SiPixelDigitizerAlgorithm::siPixelQualityLabel
private

Definition at line 98 of file SiPixelDigitizerAlgorithm.h.

const float SiPixelDigitizerAlgorithm::tanLorentzAnglePerTesla_BPix
private

Definition at line 368 of file SiPixelDigitizerAlgorithm.h.

Referenced by DriftDirection().

const float SiPixelDigitizerAlgorithm::tanLorentzAnglePerTesla_FPix
private

Definition at line 367 of file SiPixelDigitizerAlgorithm.h.

Referenced by DriftDirection().

SiPixelTemplate2D SiPixelDigitizerAlgorithm::templ2D
private

Definition at line 315 of file SiPixelDigitizerAlgorithm.h.

Referenced by PixelTempRewgt2D().

std::vector<SiPixelTemplateStore2D> SiPixelDigitizerAlgorithm::templateStores_
private

Definition at line 321 of file SiPixelDigitizerAlgorithm.h.

const int SiPixelDigitizerAlgorithm::theAdcFullScale
private

Definition at line 345 of file SiPixelDigitizerAlgorithm.h.

Referenced by make_digis(), and SiPixelDigitizerAlgorithm().

const float SiPixelDigitizerAlgorithm::theElectronPerADC
private
const float SiPixelDigitizerAlgorithm::theGainSmearing
private

Definition at line 392 of file SiPixelDigitizerAlgorithm.h.

const float SiPixelDigitizerAlgorithm::theNoiseInElectrons
private

Definition at line 346 of file SiPixelDigitizerAlgorithm.h.

Referenced by add_noise(), and digitize().

const std::unique_ptr<GaussianTailNoiseGenerator> SiPixelDigitizerAlgorithm::theNoiser
private

Definition at line 411 of file SiPixelDigitizerAlgorithm.h.

Referenced by add_noise().

const float SiPixelDigitizerAlgorithm::theOffsetSmearing
private

Definition at line 393 of file SiPixelDigitizerAlgorithm.h.

const float SiPixelDigitizerAlgorithm::theReadoutNoise
private

Definition at line 347 of file SiPixelDigitizerAlgorithm.h.

Referenced by add_noise().

const std::unique_ptr<SiPixelGainCalibrationOfflineSimService> SiPixelDigitizerAlgorithm::theSiPixelGainCalibrationService_
private

Definition at line 459 of file SiPixelDigitizerAlgorithm.h.

Referenced by pixel_inefficiency_db().

const float SiPixelDigitizerAlgorithm::theThresholdInE_BPix
private
const float SiPixelDigitizerAlgorithm::theThresholdInE_BPix_L1
private

Definition at line 352 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize(), make_digis(), and SiPixelDigitizerAlgorithm().

const float SiPixelDigitizerAlgorithm::theThresholdInE_BPix_L2
private

Definition at line 353 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize(), make_digis(), and SiPixelDigitizerAlgorithm().

const float SiPixelDigitizerAlgorithm::theThresholdInE_FPix
private
const double SiPixelDigitizerAlgorithm::theThresholdSmearing_BPix
private

Definition at line 356 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const double SiPixelDigitizerAlgorithm::theThresholdSmearing_BPix_L1
private

Definition at line 357 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const double SiPixelDigitizerAlgorithm::theThresholdSmearing_BPix_L2
private

Definition at line 358 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const double SiPixelDigitizerAlgorithm::theThresholdSmearing_FPix
private

Definition at line 355 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const float SiPixelDigitizerAlgorithm::theTofLowerCut
private

Definition at line 365 of file SiPixelDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

const float SiPixelDigitizerAlgorithm::theTofUpperCut
private

Definition at line 366 of file SiPixelDigitizerAlgorithm.h.

Referenced by accumulateSimHits().

const double SiPixelDigitizerAlgorithm::tMax
private

Definition at line 406 of file SiPixelDigitizerAlgorithm.h.

Referenced by fluctuateEloss(), and SiPixelDigitizerAlgorithm().

std::vector<float> SiPixelDigitizerAlgorithm::track
private

Definition at line 318 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight(), and PixelTempRewgt2D().

const bool SiPixelDigitizerAlgorithm::use_deadmodule_DB_
private

Definition at line 309 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const bool SiPixelDigitizerAlgorithm::use_ineff_from_db_
private

Definition at line 307 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const bool SiPixelDigitizerAlgorithm::use_LorentzAngle_DB_
private

Definition at line 310 of file SiPixelDigitizerAlgorithm.h.

Referenced by DriftDirection().

const bool SiPixelDigitizerAlgorithm::use_module_killing_
private

Definition at line 308 of file SiPixelDigitizerAlgorithm.h.

Referenced by digitize().

const bool SiPixelDigitizerAlgorithm::UseReweighting
private

Definition at line 397 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight(), and induce_signal().

std::vector<bool> SiPixelDigitizerAlgorithm::xdouble
private

Definition at line 316 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight(), and PixelTempRewgt2D().

std::vector<bool> SiPixelDigitizerAlgorithm::ydouble
private

Definition at line 317 of file SiPixelDigitizerAlgorithm.h.

Referenced by hitSignalReweight(), and PixelTempRewgt2D().