CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
analyzer::SiPixelLorentzAngle Class Reference

#include <SiPixelLorentzAngle.h>

Inheritance diagram for analyzer::SiPixelLorentzAngle:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginJob () override
 
void endJob () override
 
 SiPixelLorentzAngle (const edm::ParameterSet &conf)
 
 ~SiPixelLorentzAngle () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void fillPix (const SiPixelCluster &LocPix, const PixelTopology *topol, Pixinfo &pixinfo)
 
void findMean (int i, int i_ring)
 

Private Attributes

std::map< int, TH2F * > _h_drift_depth_
 
std::map< int, TH2F * > _h_drift_depth_adc2_
 
std::map< int, TH2F * > _h_drift_depth_adc_
 
std::map< int, TH2F * > _h_drift_depth_noadc_
 
std::map< int, TH1F * > _h_mean_
 
int bladeF_
 
double chi2_
 
double chi2F_
 
Clust clust_
 
double clustChargeMax_
 
Clust clustF_
 
int clustSizeYMin_
 
int diskF_
 
float eta_
 
float etaF_
 
int event_
 
int event_counter_
 
int eventF_
 
std::string filename_
 
std::string filenameFit_
 
TH2F * h_cluster_shape_
 
TH2F * h_cluster_shape_adc_
 
TH2F * h_cluster_shape_adc_rot_
 
TH2F * h_cluster_shape_noadc_
 
TH2F * h_cluster_shape_noadc_rot_
 
TH2F * h_cluster_shape_rot_
 
TH1F * h_drift_depth_adc_slice_
 
TH1F * h_tracks_
 
TFile * hFile_
 
int hist_depth_
 
int hist_drift_
 
int hist_x_
 
int hist_y_
 
int hitCounter_
 
int isflipped_
 
int ladder_
 
int layer_
 
double max_depth_
 
double max_drift_
 
double max_x_
 
double max_y_
 
double min_depth_
 
double min_drift_
 
double min_x_
 
double min_y_
 
int module_
 
int moduleF_
 
double ndof_
 
double ndofF_
 
double normChi2Max_
 
int panelF_
 
float phi_
 
float phiF_
 
int pixelTracksCounter_
 
Pixinfo pixinfo_
 
Pixinfo pixinfoF_
 
float pt_
 
float ptF_
 
double ptmin_
 
Rechit rechit_
 
Rechit rechitF_
 
double residualMax_
 
const TransientTrackingRecHitBuilderRHBuilder
 
int run_
 
int runF_
 
int sideF_
 
bool simData_
 
Hit simhit_
 
Hit simhitF_
 
TTree * SiPixelLorentzAngleTree_
 
TTree * SiPixelLorentzAngleTreeForward_
 
edm::EDGetTokenT< TrajTrackAssociationCollectiont_trajTrack
 
Chi2MeasurementEstimatortheEstimator
 
const KFTrajectoryFittertheFitter
 
PropagatorWithMaterialthePropagator
 
PropagatorWithMaterialthePropagatorOp
 
const KFTrajectorySmoothertheSmoother
 
KFUpdatortheUpdator
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomToken_
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtrackerTopoToken_
 
int trackEventsCounter_
 
Hit trackhit_
 
Hit trackhitF_
 
TrajectoryStateTransform tsTransform
 
int usedHitCounter_
 
double width_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 83 of file SiPixelLorentzAngle.h.

Constructor & Destructor Documentation

◆ SiPixelLorentzAngle()

SiPixelLorentzAngle::SiPixelLorentzAngle ( const edm::ParameterSet conf)
explicit

Definition at line 38 of file SiPixelLorentzAngle.cc.

References edm::ParameterSet::getParameter(), hist_x_, hist_y_, max_depth_, max_drift_, max_x_, max_y_, min_depth_, min_drift_, min_x_, min_y_, t_trajTrack, trackerGeomToken_, trackerTopoToken_, and width_.

39  : filename_(conf.getParameter<std::string>("fileName")),
40  filenameFit_(conf.getParameter<std::string>("fileNameFit")),
41  ptmin_(conf.getParameter<double>("ptMin")),
42  simData_(conf.getParameter<bool>("simData")),
43  normChi2Max_(conf.getParameter<double>("normChi2Max")),
44  clustSizeYMin_(conf.getParameter<int>("clustSizeYMin")),
45  residualMax_(conf.getParameter<double>("residualMax")),
46  clustChargeMax_(conf.getParameter<double>("clustChargeMax")),
47  hist_depth_(conf.getParameter<int>("binsDepth")),
48  hist_drift_(conf.getParameter<int>("binsDrift")),
50  // anglefinder_=new TrackLocalAngle(conf);
51  hist_x_ = 50;
52  hist_y_ = 100;
53  min_x_ = -500.;
54  max_x_ = 500.;
55  min_y_ = -1500.;
56  max_y_ = 500.;
57  width_ = 0.0285;
58  min_depth_ = -100.;
59  max_depth_ = 400.;
60  min_drift_ = -1000.; //-200.;(conf.getParameter<double>("residualMax"))
61  max_drift_ = 1000.; //400.;
62 
63  t_trajTrack = consumes<TrajTrackAssociationCollection>(conf.getParameter<edm::InputTag>("src"));
64  trackerTopoToken_ = esConsumes<TrackerTopology, TrackerTopologyRcd>();
65  trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
66 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< TrajTrackAssociationCollection > t_trajTrack
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_

◆ ~SiPixelLorentzAngle()

SiPixelLorentzAngle::~SiPixelLorentzAngle ( )
overridedefault

Member Function Documentation

◆ analyze()

void SiPixelLorentzAngle::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 181 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, Pixinfo::adc, Hit::alpha, edm::AssociationMap< Tag >::begin(), Hit::beta, bladeF_, Clust::charge, chi2_, Trajectory::chiSquared(), clust_, clustChargeMax_, SiPixelRecHit::cluster(), clustF_, clustSizeYMin_, Pixinfo::col, edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, gather_cfg::cout, hcalRecHitTable_cff::depth, diskF_, shallow::drift(), PVValHelper::dx, PVValHelper::dy, MillePedeFileConverter_cfg::e, edm::AssociationMap< Tag >::empty(), edm::AssociationMap< Tag >::end(), eta_, event_, event_counter_, HcalObjRepresent::Fill(), fillPix(), Hit::gamma, edm::EventSetup::getHandle(), h_cluster_shape_adc_, h_cluster_shape_adc_rot_, h_cluster_shape_noadc_, h_cluster_shape_noadc_rot_, h_tracks_, hitCounter_, isflipped_, TrajectoryStateOnSurface::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, ladder_, layer_, TrajectoryStateOnSurface::localDirection(), BaseTrackerRecHit::localPosition(), TrajectoryStateOnSurface::localPosition(), muonTagProbeFilters_cff::matched, Clust::maxPixelCol, Clust::maxPixelRow, Trajectory::measurements(), Clust::minPixelCol, Clust::minPixelRow, module_, moduleF_, Trajectory::ndof(), ndof_, normChi2Max_, Pixinfo::npix, panelF_, PV3DBase< T, PVType, FrameType >::perp(), phi_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pixelTracksCounter_, pixinfo_, pixinfoF_, edm::ESHandle< T >::product(), pt_, ptmin_, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), TrackerTopology::pxfSide(), rpcPointValidation_cfi::recHit, rechit_, rechitF_, residualMax_, Pixinfo::row, run_, sideF_, simData_, simhit_, simhitF_, SiPixelLorentzAngleTree_, SiPixelLorentzAngleTreeForward_, Clust::size_x, Clust::size_y, PixelGeomDetUnit::specificTopology(), GeomDet::surface(), t_trajTrack, funct::tan(), Surface::toGlobal(), HLT_2024v11_cff::track, DetId::Tracker, PbPb_ZMuSkimMuonDPG_cff::tracker, trackerGeomToken_, trackerHitAssociatorConfig_, trackerTopoToken_, trackEventsCounter_, trackhit_, trackhitF_, usedHitCounter_, width_, Pixinfo::x, x, Hit::x, PV3DBase< T, PVType, FrameType >::x(), Clust::x, Rechit::x, Pixinfo::y, Hit::y, PV3DBase< T, PVType, FrameType >::y(), Clust::y, Rechit::y, and PV3DBase< T, PVType, FrameType >::z().

181  {
182  //Retrieve tracker topology from geometry
183  edm::ESHandle<TrackerTopology> tTopoHandle = es.getHandle(trackerTopoToken_);
184  const TrackerTopology* const tTopo = tTopoHandle.product();
185 
186  event_counter_++;
187  // if(event_counter_ % 500 == 0) cout << "event number " << event_counter_ << endl;
188  cout << "event number " << event_counter_ << endl;
189 
190  edm::ESHandle<TrackerGeometry> estracker = es.getHandle(trackerGeomToken_);
191  const TrackerGeometry* tracker = &(*estracker);
192 
193  std::unique_ptr<TrackerHitAssociator> associate;
194  if (simData_)
195  associate = std::make_unique<TrackerHitAssociator>(e, trackerHitAssociatorConfig_);
196  // restet values
197  module_ = -1;
198  layer_ = -1;
199  ladder_ = -1;
200  isflipped_ = -1;
201  pt_ = -999;
202  eta_ = 999;
203  phi_ = 999;
204  pixinfo_.npix = 0;
205 
206  run_ = e.id().run();
207  event_ = e.id().event();
208 
209  // get the association map between tracks and trajectories
210  edm::Handle<TrajTrackAssociationCollection> trajTrackCollectionHandle;
211  e.getByToken(t_trajTrack, trajTrackCollectionHandle);
212  if (!trajTrackCollectionHandle->empty()) {
214  for (TrajTrackAssociationCollection::const_iterator it = trajTrackCollectionHandle->begin();
215  it != trajTrackCollectionHandle->end();
216  ++it) {
217  const Track& track = *it->val;
218  const Trajectory& traj = *it->key;
219 
220  // get the trajectory measurements
221  std::vector<TrajectoryMeasurement> tmColl = traj.measurements();
222  // TrajectoryStateOnSurface tsos = tsoscomb( itTraj->forwardPredictedState(), itTraj->backwardPredictedState() );
223  pt_ = track.pt();
224  eta_ = track.eta();
225  phi_ = track.phi();
226  chi2_ = traj.chiSquared();
227  ndof_ = traj.ndof();
228  if (pt_ < ptmin_)
229  continue;
230  // iterate over trajectory measurements
231  std::vector<PSimHit> matched;
232  h_tracks_->Fill(0);
233  bool pixeltrack = false;
234  for (std::vector<TrajectoryMeasurement>::const_iterator itTraj = tmColl.begin(); itTraj != tmColl.end();
235  itTraj++) {
236  if (!itTraj->updatedState().isValid())
237  continue;
239  if (!recHit->isValid() || recHit->geographicalId().det() != DetId::Tracker)
240  continue;
241  unsigned int subDetID = (recHit->geographicalId().subdetId());
242  if (subDetID == PixelSubdetector::PixelBarrel || subDetID == PixelSubdetector::PixelEndcap) {
243  if (!pixeltrack) {
244  h_tracks_->Fill(1);
246  }
247  pixeltrack = true;
248  }
249  if (subDetID == PixelSubdetector::PixelBarrel) {
250  hitCounter_++;
251 
252  DetId detIdObj = recHit->geographicalId();
253  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(tracker->idToDet(detIdObj));
254  if (!theGeomDet)
255  continue;
256 
257  const PixelTopology* topol = &(theGeomDet->specificTopology());
258 
259  if (!topol)
260  continue;
261 
262  layer_ = tTopo->pxbLayer(detIdObj);
263  ladder_ = tTopo->pxbLadder(detIdObj);
264  module_ = tTopo->pxbModule(detIdObj);
265  float tmp1 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 0.)).perp();
266  float tmp2 = theGeomDet->surface().toGlobal(Local3DPoint(0., 0., 1.)).perp();
267  if (tmp2 < tmp1)
268  isflipped_ = 1;
269  else
270  isflipped_ = 0;
271  const SiPixelRecHit* recHitPix = dynamic_cast<const SiPixelRecHit*>((*recHit).hit());
272  if (!recHitPix)
273  continue;
274  rechit_.x = recHitPix->localPosition().x();
275  rechit_.y = recHitPix->localPosition().y();
276  SiPixelRecHit::ClusterRef const& cluster = recHitPix->cluster();
277 
278  // fill entries in clust_
279  clust_.x = (cluster)->x();
280  clust_.y = (cluster)->y();
281  clust_.charge = (cluster->charge()) / 1000.;
282  clust_.size_x = cluster->sizeX();
283  clust_.size_y = cluster->sizeY();
284  clust_.maxPixelCol = cluster->maxPixelCol();
285  clust_.maxPixelRow = cluster->maxPixelRow();
286  clust_.minPixelCol = cluster->minPixelCol();
287  clust_.minPixelRow = cluster->minPixelRow();
288  // fill entries in pixinfo_:
289  fillPix(*cluster, topol, pixinfo_);
290  // fill the trackhit info
291  TrajectoryStateOnSurface tsos = itTraj->updatedState();
292  if (!tsos.isValid()) {
293  cout << "tsos not valid" << endl;
294  continue;
295  }
296  LocalVector trackdirection = tsos.localDirection();
297  LocalPoint trackposition = tsos.localPosition();
298 
299  if (trackdirection.z() == 0)
300  continue;
301  // the local position and direction
302  trackhit_.alpha = atan2(trackdirection.z(), trackdirection.x());
303  trackhit_.beta = atan2(trackdirection.z(), trackdirection.y());
304  trackhit_.gamma = atan2(trackdirection.x(), trackdirection.y());
305  trackhit_.x = trackposition.x();
306  trackhit_.y = trackposition.y();
307 
308  // fill entries in simhit_:
309  if (simData_) {
310  matched.clear();
311  matched = associate->associateHit((*recHitPix));
312  float dr_start = 9999.;
313  for (std::vector<PSimHit>::iterator isim = matched.begin(); isim != matched.end(); ++isim) {
314  DetId simdetIdObj((*isim).detUnitId());
315  if (simdetIdObj == detIdObj) {
316  float sim_x1 = (*isim).entryPoint().x(); // width (row index, in col direction)
317  float sim_y1 = (*isim).entryPoint().y(); // length (col index, in row direction)
318  float sim_x2 = (*isim).exitPoint().x();
319  float sim_y2 = (*isim).exitPoint().y();
320  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
321  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
322  float sim_px = (*isim).momentumAtEntry().x();
323  float sim_py = (*isim).momentumAtEntry().y();
324  float sim_pz = (*isim).momentumAtEntry().z();
325 
326  float dr = (sim_xpos - (recHitPix->localPosition().x())) * (sim_xpos - recHitPix->localPosition().x()) +
327  (sim_ypos - recHitPix->localPosition().y()) * (sim_ypos - recHitPix->localPosition().y());
328  if (dr < dr_start) {
329  simhit_.x = sim_xpos;
330  simhit_.y = sim_ypos;
331  simhit_.alpha = atan2(sim_pz, sim_px);
332  simhit_.beta = atan2(sim_pz, sim_py);
333  simhit_.gamma = atan2(sim_px, sim_py);
334  dr_start = dr;
335  }
336  }
337  } // end of filling simhit_
338  }
339  // is one pixel in cluster a large pixel ? (hit will be excluded)
340  bool large_pix = false;
341  for (int j = 0; j < pixinfo_.npix; j++) {
342  int colpos = static_cast<int>(pixinfo_.col[j]);
343  if (pixinfo_.row[j] == 0 || pixinfo_.row[j] == 79 || pixinfo_.row[j] == 80 || pixinfo_.row[j] == 159 ||
344  colpos % 52 == 0 || colpos % 52 == 51) {
345  large_pix = true;
346  }
347  }
348 
349  double residual = TMath::Sqrt((trackhit_.x - rechit_.x) * (trackhit_.x - rechit_.x) +
350  (trackhit_.y - rechit_.y) * (trackhit_.y - rechit_.y));
351 
352  SiPixelLorentzAngleTree_->Fill();
353  if (!large_pix && (chi2_ / ndof_) < normChi2Max_ && cluster->sizeY() >= clustSizeYMin_ &&
354  residual < residualMax_ && (cluster->charge() < clustChargeMax_)) {
355  usedHitCounter_++;
356  // iterate over pixels in hit
357  for (int j = 0; j < pixinfo_.npix; j++) {
358  // use trackhits
359  float dx = (pixinfo_.x[j] - (trackhit_.x - width_ / 2. / TMath::Tan(trackhit_.alpha))) * 10000.;
360  float dy = (pixinfo_.y[j] - (trackhit_.y - width_ / 2. / TMath::Tan(trackhit_.beta))) * 10000.;
361  float depth = dy * tan(trackhit_.beta);
362  float drift = dx - dy * tan(trackhit_.gamma);
366  if (layer_ == 3 && module_ == 1 && isflipped_) {
367  float dx_rot = dx * TMath::Cos(trackhit_.gamma) + dy * TMath::Sin(trackhit_.gamma);
368  float dy_rot = dy * TMath::Cos(trackhit_.gamma) - dx * TMath::Sin(trackhit_.gamma);
370  h_cluster_shape_noadc_->Fill(dx, dy);
371  h_cluster_shape_adc_rot_->Fill(dx_rot, dy_rot, pixinfo_.adc[j]);
372  h_cluster_shape_noadc_rot_->Fill(dx_rot, dy_rot);
373  }
374  }
375  }
376  } else if (subDetID == PixelSubdetector::PixelEndcap) {
377  DetId detIdObj = recHit->geographicalId();
378  const PixelGeomDetUnit* theGeomDet = dynamic_cast<const PixelGeomDetUnit*>(tracker->idToDet(detIdObj));
379  if (!theGeomDet)
380  continue;
381 
382  const PixelTopology* topol = &(theGeomDet->specificTopology());
383 
384  if (!topol)
385  continue;
386 
387  sideF_ = tTopo->pxfSide(detIdObj);
388  diskF_ = tTopo->pxfDisk(detIdObj);
389  bladeF_ = tTopo->pxfBlade(detIdObj);
390  panelF_ = tTopo->pxfPanel(detIdObj);
391  moduleF_ = tTopo->pxfModule(detIdObj);
392  //float tmp1 = theGeomDet->surface().toGlobal(Local3DPoint(0.,0.,0.)).perp();
393  //float tmp2 = theGeomDet->surface().toGlobal(Local3DPoint(0.,0.,1.)).perp();
394  //if ( tmp2<tmp1 ) isflipped_ = 1;
395  //else isflipped_ = 0;
396  const SiPixelRecHit* recHitPix = dynamic_cast<const SiPixelRecHit*>((*recHit).hit());
397  if (!recHitPix)
398  continue;
399  rechitF_.x = recHitPix->localPosition().x();
400  rechitF_.y = recHitPix->localPosition().y();
401  SiPixelRecHit::ClusterRef const& cluster = recHitPix->cluster();
402 
403  // fill entries in clust_
404  clustF_.x = (cluster)->x();
405  clustF_.y = (cluster)->y();
406  clustF_.charge = (cluster->charge()) / 1000.;
407  clustF_.size_x = cluster->sizeX();
408  clustF_.size_y = cluster->sizeY();
409  clustF_.maxPixelCol = cluster->maxPixelCol();
410  clustF_.maxPixelRow = cluster->maxPixelRow();
411  clustF_.minPixelCol = cluster->minPixelCol();
412  clustF_.minPixelRow = cluster->minPixelRow();
413  // fill entries in pixinfo_:
414  fillPix(*cluster, topol, pixinfoF_);
415  // fill the trackhit info
416  TrajectoryStateOnSurface tsos = itTraj->updatedState();
417  if (!tsos.isValid()) {
418  cout << "tsos not valid" << endl;
419  continue;
420  }
421  LocalVector trackdirection = tsos.localDirection();
422  LocalPoint trackposition = tsos.localPosition();
423 
424  if (trackdirection.z() == 0)
425  continue;
426  // the local position and direction
427  trackhitF_.alpha = atan2(trackdirection.z(), trackdirection.x());
428  trackhitF_.beta = atan2(trackdirection.z(), trackdirection.y());
429  trackhitF_.gamma = atan2(trackdirection.x(), trackdirection.y());
430  trackhitF_.x = trackposition.x();
431  trackhitF_.y = trackposition.y();
432 
433  // fill entries in simhit_:
434  if (simData_) {
435  matched.clear();
436  matched = associate->associateHit((*recHitPix));
437  float dr_start = 9999.;
438  for (std::vector<PSimHit>::iterator isim = matched.begin(); isim != matched.end(); ++isim) {
439  DetId simdetIdObj((*isim).detUnitId());
440  if (simdetIdObj == detIdObj) {
441  float sim_x1 = (*isim).entryPoint().x(); // width (row index, in col direction)
442  float sim_y1 = (*isim).entryPoint().y(); // length (col index, in row direction)
443  float sim_x2 = (*isim).exitPoint().x();
444  float sim_y2 = (*isim).exitPoint().y();
445  float sim_xpos = 0.5 * (sim_x1 + sim_x2);
446  float sim_ypos = 0.5 * (sim_y1 + sim_y2);
447  float sim_px = (*isim).momentumAtEntry().x();
448  float sim_py = (*isim).momentumAtEntry().y();
449  float sim_pz = (*isim).momentumAtEntry().z();
450 
451  float dr = (sim_xpos - (recHitPix->localPosition().x())) * (sim_xpos - recHitPix->localPosition().x()) +
452  (sim_ypos - recHitPix->localPosition().y()) * (sim_ypos - recHitPix->localPosition().y());
453  if (dr < dr_start) {
454  simhitF_.x = sim_xpos;
455  simhitF_.y = sim_ypos;
456  simhitF_.alpha = atan2(sim_pz, sim_px);
457  simhitF_.beta = atan2(sim_pz, sim_py);
458  simhitF_.gamma = atan2(sim_px, sim_py);
459  dr_start = dr;
460  }
461  }
462  } // end of filling simhit_
463  }
465  }
466  } //end iteration over trajectory measurements
467  } //end iteration over trajectories
468  }
469 }
ClusterRef cluster() const
Definition: SiPixelRecHit.h:47
std::map< int, TH2F * > _h_drift_depth_adc2_
unsigned int pxbLayer(const DetId &id) const
T perp() const
Definition: PV3DBase.h:69
float x[maxpix]
unsigned int pxfBlade(const DetId &id) const
T z() const
Definition: PV3DBase.h:61
float y[maxpix]
unsigned int pxfModule(const DetId &id) const
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
float chiSquared() const
Definition: Trajectory.h:241
unsigned int pxbLadder(const DetId &id) const
bool empty() const
return true if empty
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopoToken_
std::map< int, TH2F * > _h_drift_depth_noadc_
DataContainer const & measurements() const
Definition: Trajectory.h:178
const_iterator end() const
last iterator over the map (read only)
double beta
TrackerHitAssociator::Config trackerHitAssociatorConfig_
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T const * product() const
Definition: ESHandle.h:86
int ndof(bool bon=true) const
Definition: Trajectory.cc:97
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< int, TH2F * > _h_drift_depth_adc_
LocalVector localDirection() const
unsigned int pxfDisk(const DetId &id) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
float adc[maxpix]
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
unsigned int pxfPanel(const DetId &id) const
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
edm::EDGetTokenT< TrajTrackAssociationCollection > t_trajTrack
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
double alpha
float col[maxpix]
const_iterator begin() const
first iterator over the map (read only)
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
LocalPoint localPosition() const override
double gamma
unsigned int pxbModule(const DetId &id) const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomToken_
float row[maxpix]
void fillPix(const SiPixelCluster &LocPix, const PixelTopology *topol, Pixinfo &pixinfo)
Our base class.
Definition: SiPixelRecHit.h:23
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

◆ beginJob()

void SiPixelLorentzAngle::beginJob ( )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 71 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_, _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, _h_mean_, Pixinfo::adc, bladeF_, chi2_, clust_, clustF_, Pixinfo::col, diskF_, eta_, event_, event_counter_, filename_, h_cluster_shape_, h_cluster_shape_adc_, h_cluster_shape_adc_rot_, h_cluster_shape_noadc_, h_cluster_shape_noadc_rot_, h_cluster_shape_rot_, h_tracks_, hFile_, hist_depth_, hist_drift_, hist_x_, hist_y_, hitCounter_, isflipped_, ladder_, layer_, max_depth_, max_drift_, max_x_, max_y_, min_depth_, min_drift_, min_x_, min_y_, module_, moduleF_, Skims_PA_cff::name, ndof_, Pixinfo::npix, panelF_, phi_, pixelTracksCounter_, pixinfo_, pixinfoF_, pt_, rechit_, rechitF_, Pixinfo::row, run_, sideF_, simhit_, simhitF_, SiPixelLorentzAngleTree_, SiPixelLorentzAngleTreeForward_, trackEventsCounter_, trackhit_, trackhitF_, usedHitCounter_, Pixinfo::x, and Pixinfo::y.

71  {
72  // cout << "started SiPixelLorentzAngle" << endl;
73  hFile_ = new TFile(filename_.c_str(), "RECREATE");
74  int bufsize = 64000;
75  // create tree structure
76  SiPixelLorentzAngleTree_ = new TTree("SiPixelLorentzAngleTree_", "SiPixel LorentzAngle tree", bufsize);
77  SiPixelLorentzAngleTree_->Branch("run", &run_, "run/I", bufsize);
78  SiPixelLorentzAngleTree_->Branch("event", &event_, "event/I", bufsize);
79  SiPixelLorentzAngleTree_->Branch("module", &module_, "module/I", bufsize);
80  SiPixelLorentzAngleTree_->Branch("ladder", &ladder_, "ladder/I", bufsize);
81  SiPixelLorentzAngleTree_->Branch("layer", &layer_, "layer/I", bufsize);
82  SiPixelLorentzAngleTree_->Branch("isflipped", &isflipped_, "isflipped/I", bufsize);
83  SiPixelLorentzAngleTree_->Branch("pt", &pt_, "pt/F", bufsize);
84  SiPixelLorentzAngleTree_->Branch("eta", &eta_, "eta/F", bufsize);
85  SiPixelLorentzAngleTree_->Branch("phi", &phi_, "phi/F", bufsize);
86  SiPixelLorentzAngleTree_->Branch("chi2", &chi2_, "chi2/D", bufsize);
87  SiPixelLorentzAngleTree_->Branch("ndof", &ndof_, "ndof/D", bufsize);
88  SiPixelLorentzAngleTree_->Branch("trackhit", &trackhit_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
89  SiPixelLorentzAngleTree_->Branch("simhit", &simhit_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
90  SiPixelLorentzAngleTree_->Branch("npix", &pixinfo_.npix, "npix/I", bufsize);
91  SiPixelLorentzAngleTree_->Branch("rowpix", pixinfo_.row, "row[npix]/F", bufsize);
92  SiPixelLorentzAngleTree_->Branch("colpix", pixinfo_.col, "col[npix]/F", bufsize);
93  SiPixelLorentzAngleTree_->Branch("adc", pixinfo_.adc, "adc[npix]/F", bufsize);
94  SiPixelLorentzAngleTree_->Branch("xpix", pixinfo_.x, "x[npix]/F", bufsize);
95  SiPixelLorentzAngleTree_->Branch("ypix", pixinfo_.y, "y[npix]/F", bufsize);
97  "clust",
98  &clust_,
99  "x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I",
100  bufsize);
101  SiPixelLorentzAngleTree_->Branch("rechit", &rechit_, "x/F:y/F", bufsize);
102 
104  new TTree("SiPixelLorentzAngleTreeForward_", "SiPixel LorentzAngle tree forward", bufsize);
105  SiPixelLorentzAngleTreeForward_->Branch("run", &run_, "run/I", bufsize);
106  SiPixelLorentzAngleTreeForward_->Branch("event", &event_, "event/I", bufsize);
107  SiPixelLorentzAngleTreeForward_->Branch("side", &sideF_, "side/I", bufsize);
108  SiPixelLorentzAngleTreeForward_->Branch("disk", &diskF_, "disk/I", bufsize);
109  SiPixelLorentzAngleTreeForward_->Branch("blade", &bladeF_, "blade/I", bufsize);
110  SiPixelLorentzAngleTreeForward_->Branch("panel", &panelF_, "panel/I", bufsize);
111  SiPixelLorentzAngleTreeForward_->Branch("module", &moduleF_, "module/I", bufsize);
112  SiPixelLorentzAngleTreeForward_->Branch("pt", &pt_, "pt/F", bufsize);
113  SiPixelLorentzAngleTreeForward_->Branch("eta", &eta_, "eta/F", bufsize);
114  SiPixelLorentzAngleTreeForward_->Branch("phi", &phi_, "phi/F", bufsize);
115  SiPixelLorentzAngleTreeForward_->Branch("chi2", &chi2_, "chi2/D", bufsize);
116  SiPixelLorentzAngleTreeForward_->Branch("ndof", &ndof_, "ndof/D", bufsize);
117  SiPixelLorentzAngleTreeForward_->Branch("trackhit", &trackhitF_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
118  SiPixelLorentzAngleTreeForward_->Branch("simhit", &simhitF_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
119  SiPixelLorentzAngleTreeForward_->Branch("npix", &pixinfoF_.npix, "npix/I", bufsize);
120  SiPixelLorentzAngleTreeForward_->Branch("rowpix", pixinfoF_.row, "row[npix]/F", bufsize);
121  SiPixelLorentzAngleTreeForward_->Branch("colpix", pixinfoF_.col, "col[npix]/F", bufsize);
122  SiPixelLorentzAngleTreeForward_->Branch("adc", pixinfoF_.adc, "adc[npix]/F", bufsize);
123  SiPixelLorentzAngleTreeForward_->Branch("xpix", pixinfoF_.x, "x[npix]/F", bufsize);
124  SiPixelLorentzAngleTreeForward_->Branch("ypix", pixinfoF_.y, "y[npix]/F", bufsize);
126  "clust",
127  &clustF_,
128  "x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I",
129  bufsize);
130  SiPixelLorentzAngleTreeForward_->Branch("rechit", &rechitF_, "x/F:y/F", bufsize);
131 
132  //book histograms
133  char name[128];
134  for (int i_module = 1; i_module <= 8; i_module++) {
135  for (int i_layer = 1; i_layer <= 3; i_layer++) {
136  sprintf(name, "h_drift_depth_adc_layer%i_module%i", i_layer, i_module);
137  _h_drift_depth_adc_[i_module + (i_layer - 1) * 8] =
139  sprintf(name, "h_drift_depth_adc2_layer%i_module%i", i_layer, i_module);
140  _h_drift_depth_adc2_[i_module + (i_layer - 1) * 8] =
142  sprintf(name, "h_drift_depth_noadc_layer%i_module%i", i_layer, i_module);
143  _h_drift_depth_noadc_[i_module + (i_layer - 1) * 8] =
145  sprintf(name, "h_drift_depth_layer%i_module%i", i_layer, i_module);
146  _h_drift_depth_[i_module + (i_layer - 1) * 8] =
148  sprintf(name, "h_mean_layer%i_module%i", i_layer, i_module);
149  _h_mean_[i_module + (i_layer - 1) * 8] = new TH1F(name, name, hist_depth_, min_depth_, max_depth_);
150  }
151  }
152 
153  // just for some expaining plots
154  h_cluster_shape_adc_ = new TH2F(
155  "h_cluster_shape_adc", "cluster shape with adc weight", hist_x_, min_x_, max_x_, hist_y_, min_y_, max_y_);
156  h_cluster_shape_noadc_ = new TH2F(
157  "h_cluster_shape_noadc", "cluster shape without adc weight", hist_x_, min_x_, max_x_, hist_y_, min_y_, max_y_);
158  h_cluster_shape_ = new TH2F("h_cluster_shape", "cluster shape", hist_x_, min_x_, max_x_, hist_y_, min_y_, max_y_);
159  h_cluster_shape_adc_rot_ = new TH2F(
160  "h_cluster_shape_adc_rot", "cluster shape with adc weight", hist_x_, min_x_, max_x_, hist_y_, -max_y_, -min_y_);
161  h_cluster_shape_noadc_rot_ = new TH2F("h_cluster_shape_noadc_rot",
162  "cluster shape without adc weight",
163  hist_x_,
164  min_x_,
165  max_x_,
166  hist_y_,
167  -max_y_,
168  -min_y_);
170  new TH2F("h_cluster_shape_rot", "cluster shape", hist_x_, min_x_, max_x_, hist_y_, -max_y_, -min_y_);
171  h_tracks_ = new TH1F("h_tracks", "h_tracks", 2, 0., 2.);
172  event_counter_ = 0;
174  // trackcounter_ = 0;
175  hitCounter_ = 0;
176  usedHitCounter_ = 0;
178 }
std::map< int, TH2F * > _h_drift_depth_adc2_
float x[maxpix]
float y[maxpix]
std::map< int, TH2F * > _h_drift_depth_
std::map< int, TH2F * > _h_drift_depth_noadc_
std::map< int, TH2F * > _h_drift_depth_adc_
std::map< int, TH1F * > _h_mean_
float adc[maxpix]
float col[maxpix]
float row[maxpix]

◆ endJob()

void SiPixelLorentzAngle::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 471 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_, _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, _h_mean_, nano_mu_local_reco_cff::chi2, gather_cfg::cout, StorageManager_cfg::e1, event_counter_, DeadROC_duringRun::f1, filenameFit_, findMean(), h_cluster_shape_adc_, h_cluster_shape_adc_rot_, h_cluster_shape_noadc_, h_cluster_shape_noadc_rot_, h_drift_depth_adc_slice_, h_tracks_, hFile_, hist_depth_, hist_drift_, hitCounter_, mps_fire::i, max_drift_, min_drift_, LaserDQM_cfg::p1, pixelTracksCounter_, TtFullHadEvtBuilder_cfi::prob, trackEventsCounter_, pileupReCalc_HLTpaths::trunc, and usedHitCounter_.

Referenced by o2olib.O2ORunMgr::executeJob().

471  {
472  // produce histograms with the average adc counts
473  for (int i_ring = 1; i_ring <= 24; i_ring++) {
474  _h_drift_depth_[i_ring]->Divide(_h_drift_depth_adc_[i_ring], _h_drift_depth_noadc_[i_ring]);
475  }
476 
478  new TH1F("h_drift_depth_adc_slice", "slice of adc histogram", hist_drift_, min_drift_, max_drift_);
479 
480  TF1* f1 = new TF1("f1", "[0] + [1]*x", 50., 235.);
481  f1->SetParName(0, "p0");
482  f1->SetParName(1, "p1");
483  f1->SetParameter(0, 0);
484  f1->SetParameter(1, 0.4);
485  ofstream fLorentzFit(filenameFit_.c_str(), ios::trunc);
486  cout.precision(4);
487  fLorentzFit << "module"
488  << "\t"
489  << "layer"
490  << "\t"
491  << "offset"
492  << "\t"
493  << "error"
494  << "\t"
495  << "slope"
496  << "\t"
497  << "error"
498  << "\t"
499  "rel.err"
500  << "\t"
501  "pull"
502  << "\t"
503  << "chi2"
504  << "\t"
505  << "prob" << endl;
506  //loop over modlues and layers to fit the lorentz angle
507  for (int i_layer = 1; i_layer <= 3; i_layer++) {
508  for (int i_module = 1; i_module <= 8; i_module++) {
509  //loop over bins in depth (z-local-coordinate) (in order to fit slices)
510  for (int i = 1; i <= hist_depth_; i++) {
511  findMean(i, (i_module + (i_layer - 1) * 8));
512  } // end loop over bins in depth
513  _h_mean_[i_module + (i_layer - 1) * 8]->Fit(f1, "ERQ");
514  double p0 = f1->GetParameter(0);
515  double e0 = f1->GetParError(0);
516  double p1 = f1->GetParameter(1);
517  double e1 = f1->GetParError(1);
518  double chi2 = f1->GetChisquare();
519  double prob = f1->GetProb();
520  fLorentzFit << setprecision(4) << i_module << "\t" << i_layer << "\t" << p0 << "\t" << e0 << "\t" << p1
521  << setprecision(3) << "\t" << e1 << "\t" << e1 / p1 * 100. << "\t" << (p1 - 0.424) / e1 << "\t"
522  << chi2 << "\t" << prob << endl;
523  }
524  } // end loop over modules and layers
525  fLorentzFit.close();
526  hFile_->cd();
527  for (int i_module = 1; i_module <= 8; i_module++) {
528  for (int i_layer = 1; i_layer <= 3; i_layer++) {
529  _h_drift_depth_adc_[i_module + (i_layer - 1) * 8]->Write();
530  _h_drift_depth_adc2_[i_module + (i_layer - 1) * 8]->Write();
531  _h_drift_depth_noadc_[i_module + (i_layer - 1) * 8]->Write();
532  _h_drift_depth_[i_module + (i_layer - 1) * 8]->Write();
533  _h_mean_[i_module + (i_layer - 1) * 8]->Write();
534  }
535  }
536  h_cluster_shape_adc_->Write();
537  h_cluster_shape_noadc_->Write();
538  h_cluster_shape_adc_rot_->Write();
540  h_tracks_->Write();
541 
542  hFile_->Write();
543  hFile_->Close();
544  cout << "events: " << event_counter_ << endl;
545  cout << "events with tracks: " << trackEventsCounter_ << endl;
546  cout << "events with pixeltracks: " << pixelTracksCounter_ << endl;
547  cout << "hits in the pixel: " << hitCounter_ << endl;
548  cout << "number of used Hits: " << usedHitCounter_ << endl;
549 }
std::map< int, TH2F * > _h_drift_depth_adc2_
void findMean(int i, int i_ring)
std::map< int, TH2F * > _h_drift_depth_
std::map< int, TH2F * > _h_drift_depth_noadc_
Definition: Fit.h:32
std::map< int, TH2F * > _h_drift_depth_adc_
std::map< int, TH1F * > _h_mean_

◆ fillPix()

void SiPixelLorentzAngle::fillPix ( const SiPixelCluster LocPix,
const PixelTopology topol,
Pixinfo pixinfo 
)
inlineprivate

Definition at line 551 of file SiPixelLorentzAngle.cc.

References Pixinfo::adc, Pixinfo::col, Topology::localPosition(), Pixinfo::npix, SiPixelCluster::pixels(), Pixinfo::row, Pixinfo::x, PV3DBase< T, PVType, FrameType >::x(), Pixinfo::y, and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

553 {
554  const std::vector<SiPixelCluster::Pixel>& pixvector = LocPix.pixels();
555  pixinfo.npix = 0;
556  for (std::vector<SiPixelCluster::Pixel>::const_iterator itPix = pixvector.begin(); itPix != pixvector.end();
557  itPix++) {
558  // for(pixinfo.npix = 0; pixinfo.npix < static_cast<int>(pixvector.size()); ++pixinfo.npix) {
559  pixinfo.row[pixinfo.npix] = itPix->x;
560  pixinfo.col[pixinfo.npix] = itPix->y;
561  pixinfo.adc[pixinfo.npix] = itPix->adc;
562  LocalPoint lp = topol->localPosition(MeasurementPoint(itPix->x + 0.5, itPix->y + 0.5));
563  pixinfo.x[pixinfo.npix] = lp.x();
564  pixinfo.y[pixinfo.npix] = lp.y();
565  pixinfo.npix++;
566  }
567 }
float x[maxpix]
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
float y[maxpix]
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
const std::vector< Pixel > pixels() const
float adc[maxpix]
float col[maxpix]
float row[maxpix]

◆ findMean()

void SiPixelLorentzAngle::findMean ( int  i,
int  i_ring 
)
private

Definition at line 569 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_, _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, _h_mean_, relativeConstraints::error, h_drift_depth_adc_slice_, hist_drift_, mps_fire::i, dqmiolumiharvest::j, SiStripPI::mean, and mathSSE::sqrt().

Referenced by endJob().

569  {
570  double nentries = 0;
571 
572  h_drift_depth_adc_slice_->Reset("ICE");
573 
574  // determine sigma and sigma^2 of the adc counts and average adc counts
575  //loop over bins in drift width
576  for (int j = 1; j <= hist_drift_; j++) {
577  if (_h_drift_depth_noadc_[i_ring]->GetBinContent(j, i) >= 1) {
578  double adc_error2 =
579  (_h_drift_depth_adc2_[i_ring]->GetBinContent(j, i) - _h_drift_depth_adc_[i_ring]->GetBinContent(j, i) *
580  _h_drift_depth_adc_[i_ring]->GetBinContent(j, i) /
581  _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i)) /
582  _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i);
583  _h_drift_depth_adc_[i_ring]->SetBinError(j, i, sqrt(adc_error2));
584  double error2 = adc_error2 / (_h_drift_depth_noadc_[i_ring]->GetBinContent(j, i) - 1.);
585  _h_drift_depth_[i_ring]->SetBinError(j, i, sqrt(error2));
586  } else {
587  _h_drift_depth_[i_ring]->SetBinError(j, i, 0);
588  _h_drift_depth_adc_[i_ring]->SetBinError(j, i, 0);
589  }
590  h_drift_depth_adc_slice_->SetBinContent(j, _h_drift_depth_adc_[i_ring]->GetBinContent(j, i));
591  h_drift_depth_adc_slice_->SetBinError(j, _h_drift_depth_adc_[i_ring]->GetBinError(j, i));
592  nentries += _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i);
593  } // end loop over bins in drift width
594 
595  double mean = h_drift_depth_adc_slice_->GetMean(1);
596  double error = 0;
597  if (nentries != 0) {
598  error = h_drift_depth_adc_slice_->GetRMS(1) / sqrt(nentries);
599  }
600 
601  _h_mean_[i_ring]->SetBinContent(i, mean);
602  _h_mean_[i_ring]->SetBinError(i, error);
603 }
std::map< int, TH2F * > _h_drift_depth_adc2_
std::map< int, TH2F * > _h_drift_depth_
std::map< int, TH2F * > _h_drift_depth_noadc_
T sqrt(T t)
Definition: SSEVec.h:19
std::map< int, TH2F * > _h_drift_depth_adc_
std::map< int, TH1F * > _h_mean_

Member Data Documentation

◆ _h_drift_depth_

std::map<int, TH2F *> analyzer::SiPixelLorentzAngle::_h_drift_depth_
private

Definition at line 167 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), endJob(), and findMean().

◆ _h_drift_depth_adc2_

std::map<int, TH2F *> analyzer::SiPixelLorentzAngle::_h_drift_depth_adc2_
private

Definition at line 165 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), endJob(), and findMean().

◆ _h_drift_depth_adc_

std::map<int, TH2F *> analyzer::SiPixelLorentzAngle::_h_drift_depth_adc_
private

Definition at line 164 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), endJob(), and findMean().

◆ _h_drift_depth_noadc_

std::map<int, TH2F *> analyzer::SiPixelLorentzAngle::_h_drift_depth_noadc_
private

Definition at line 166 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), endJob(), and findMean().

◆ _h_mean_

std::map<int, TH1F *> analyzer::SiPixelLorentzAngle::_h_mean_
private

Definition at line 169 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), endJob(), and findMean().

◆ bladeF_

int analyzer::SiPixelLorentzAngle::bladeF_
private

Definition at line 123 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ chi2_

double analyzer::SiPixelLorentzAngle::chi2_
private

Definition at line 111 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ chi2F_

double analyzer::SiPixelLorentzAngle::chi2F_
private

Definition at line 129 of file SiPixelLorentzAngle.h.

◆ clust_

Clust analyzer::SiPixelLorentzAngle::clust_
private

Definition at line 115 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ clustChargeMax_

double analyzer::SiPixelLorentzAngle::clustChargeMax_
private

Definition at line 144 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ clustF_

Clust analyzer::SiPixelLorentzAngle::clustF_
private

Definition at line 133 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ clustSizeYMin_

int analyzer::SiPixelLorentzAngle::clustSizeYMin_
private

Definition at line 142 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ diskF_

int analyzer::SiPixelLorentzAngle::diskF_
private

Definition at line 122 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ eta_

float analyzer::SiPixelLorentzAngle::eta_
private

Definition at line 109 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ etaF_

float analyzer::SiPixelLorentzAngle::etaF_
private

Definition at line 127 of file SiPixelLorentzAngle.h.

◆ event_

int analyzer::SiPixelLorentzAngle::event_
private

Definition at line 103 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ event_counter_

int analyzer::SiPixelLorentzAngle::event_counter_
private

Definition at line 178 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ eventF_

int analyzer::SiPixelLorentzAngle::eventF_
private

Definition at line 120 of file SiPixelLorentzAngle.h.

◆ filename_

std::string analyzer::SiPixelLorentzAngle::filename_
private

Definition at line 137 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

◆ filenameFit_

std::string analyzer::SiPixelLorentzAngle::filenameFit_
private

Definition at line 138 of file SiPixelLorentzAngle.h.

Referenced by endJob().

◆ h_cluster_shape_

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_
private

Definition at line 172 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

◆ h_cluster_shape_adc_

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_adc_
private

Definition at line 170 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ h_cluster_shape_adc_rot_

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_adc_rot_
private

Definition at line 173 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ h_cluster_shape_noadc_

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_noadc_
private

Definition at line 171 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ h_cluster_shape_noadc_rot_

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_noadc_rot_
private

Definition at line 174 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ h_cluster_shape_rot_

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_rot_
private

Definition at line 175 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

◆ h_drift_depth_adc_slice_

TH1F* analyzer::SiPixelLorentzAngle::h_drift_depth_adc_slice_
private

Definition at line 168 of file SiPixelLorentzAngle.h.

Referenced by endJob(), and findMean().

◆ h_tracks_

TH1F* analyzer::SiPixelLorentzAngle::h_tracks_
private

Definition at line 176 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ hFile_

TFile* analyzer::SiPixelLorentzAngle::hFile_
private

Definition at line 97 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and endJob().

◆ hist_depth_

int analyzer::SiPixelLorentzAngle::hist_depth_
private

Definition at line 145 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and endJob().

◆ hist_drift_

int analyzer::SiPixelLorentzAngle::hist_drift_
private

Definition at line 146 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), endJob(), and findMean().

◆ hist_x_

int analyzer::SiPixelLorentzAngle::hist_x_
private

Definition at line 152 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ hist_y_

int analyzer::SiPixelLorentzAngle::hist_y_
private

Definition at line 153 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ hitCounter_

int analyzer::SiPixelLorentzAngle::hitCounter_
private

Definition at line 178 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ isflipped_

int analyzer::SiPixelLorentzAngle::isflipped_
private

Definition at line 107 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ ladder_

int analyzer::SiPixelLorentzAngle::ladder_
private

Definition at line 105 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ layer_

int analyzer::SiPixelLorentzAngle::layer_
private

Definition at line 106 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ max_depth_

double analyzer::SiPixelLorentzAngle::max_depth_
private

Definition at line 160 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ max_drift_

double analyzer::SiPixelLorentzAngle::max_drift_
private

Definition at line 162 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), endJob(), and SiPixelLorentzAngle().

◆ max_x_

double analyzer::SiPixelLorentzAngle::max_x_
private

Definition at line 155 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ max_y_

double analyzer::SiPixelLorentzAngle::max_y_
private

Definition at line 157 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ min_depth_

double analyzer::SiPixelLorentzAngle::min_depth_
private

Definition at line 159 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ min_drift_

double analyzer::SiPixelLorentzAngle::min_drift_
private

Definition at line 161 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), endJob(), and SiPixelLorentzAngle().

◆ min_x_

double analyzer::SiPixelLorentzAngle::min_x_
private

Definition at line 154 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ min_y_

double analyzer::SiPixelLorentzAngle::min_y_
private

Definition at line 156 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

◆ module_

int analyzer::SiPixelLorentzAngle::module_
private

Definition at line 104 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ moduleF_

int analyzer::SiPixelLorentzAngle::moduleF_
private

Definition at line 125 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ ndof_

double analyzer::SiPixelLorentzAngle::ndof_
private

Definition at line 112 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ ndofF_

double analyzer::SiPixelLorentzAngle::ndofF_
private

Definition at line 130 of file SiPixelLorentzAngle.h.

◆ normChi2Max_

double analyzer::SiPixelLorentzAngle::normChi2Max_
private

Definition at line 141 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ panelF_

int analyzer::SiPixelLorentzAngle::panelF_
private

Definition at line 124 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ phi_

float analyzer::SiPixelLorentzAngle::phi_
private

Definition at line 110 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ phiF_

float analyzer::SiPixelLorentzAngle::phiF_
private

Definition at line 128 of file SiPixelLorentzAngle.h.

◆ pixelTracksCounter_

int analyzer::SiPixelLorentzAngle::pixelTracksCounter_
private

Definition at line 178 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ pixinfo_

Pixinfo analyzer::SiPixelLorentzAngle::pixinfo_
private

Definition at line 113 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ pixinfoF_

Pixinfo analyzer::SiPixelLorentzAngle::pixinfoF_
private

Definition at line 131 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ pt_

float analyzer::SiPixelLorentzAngle::pt_
private

Definition at line 108 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ ptF_

float analyzer::SiPixelLorentzAngle::ptF_
private

Definition at line 126 of file SiPixelLorentzAngle.h.

◆ ptmin_

double analyzer::SiPixelLorentzAngle::ptmin_
private

Definition at line 139 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ rechit_

Rechit analyzer::SiPixelLorentzAngle::rechit_
private

Definition at line 116 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ rechitF_

Rechit analyzer::SiPixelLorentzAngle::rechitF_
private

Definition at line 134 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ residualMax_

double analyzer::SiPixelLorentzAngle::residualMax_
private

Definition at line 143 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ RHBuilder

const TransientTrackingRecHitBuilder* analyzer::SiPixelLorentzAngle::RHBuilder
private

Definition at line 185 of file SiPixelLorentzAngle.h.

◆ run_

int analyzer::SiPixelLorentzAngle::run_
private

Definition at line 102 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ runF_

int analyzer::SiPixelLorentzAngle::runF_
private

Definition at line 119 of file SiPixelLorentzAngle.h.

◆ sideF_

int analyzer::SiPixelLorentzAngle::sideF_
private

Definition at line 121 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ simData_

bool analyzer::SiPixelLorentzAngle::simData_
private

Definition at line 140 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ simhit_

Hit analyzer::SiPixelLorentzAngle::simhit_
private

Definition at line 114 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ simhitF_

Hit analyzer::SiPixelLorentzAngle::simhitF_
private

Definition at line 132 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ SiPixelLorentzAngleTree_

TTree* analyzer::SiPixelLorentzAngle::SiPixelLorentzAngleTree_
private

Definition at line 98 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ SiPixelLorentzAngleTreeForward_

TTree* analyzer::SiPixelLorentzAngle::SiPixelLorentzAngleTreeForward_
private

Definition at line 99 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ t_trajTrack

edm::EDGetTokenT<TrajTrackAssociationCollection> analyzer::SiPixelLorentzAngle::t_trajTrack
private

Definition at line 189 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().

◆ theEstimator

Chi2MeasurementEstimator* analyzer::SiPixelLorentzAngle::theEstimator
private

Definition at line 184 of file SiPixelLorentzAngle.h.

◆ theFitter

const KFTrajectoryFitter* analyzer::SiPixelLorentzAngle::theFitter
private

Definition at line 187 of file SiPixelLorentzAngle.h.

◆ thePropagator

PropagatorWithMaterial* analyzer::SiPixelLorentzAngle::thePropagator
private

Definition at line 181 of file SiPixelLorentzAngle.h.

◆ thePropagatorOp

PropagatorWithMaterial* analyzer::SiPixelLorentzAngle::thePropagatorOp
private

Definition at line 182 of file SiPixelLorentzAngle.h.

◆ theSmoother

const KFTrajectorySmoother* analyzer::SiPixelLorentzAngle::theSmoother
private

Definition at line 186 of file SiPixelLorentzAngle.h.

◆ theUpdator

KFUpdator* analyzer::SiPixelLorentzAngle::theUpdator
private

Definition at line 183 of file SiPixelLorentzAngle.h.

◆ trackerGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> analyzer::SiPixelLorentzAngle::trackerGeomToken_
private

Definition at line 191 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().

◆ trackerHitAssociatorConfig_

TrackerHitAssociator::Config analyzer::SiPixelLorentzAngle::trackerHitAssociatorConfig_
private

Definition at line 149 of file SiPixelLorentzAngle.h.

Referenced by analyze().

◆ trackerTopoToken_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> analyzer::SiPixelLorentzAngle::trackerTopoToken_
private

Definition at line 190 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().

◆ trackEventsCounter_

int analyzer::SiPixelLorentzAngle::trackEventsCounter_
private

Definition at line 178 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ trackhit_

Hit analyzer::SiPixelLorentzAngle::trackhit_
private

Definition at line 114 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ trackhitF_

Hit analyzer::SiPixelLorentzAngle::trackhitF_
private

Definition at line 132 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

◆ tsTransform

TrajectoryStateTransform analyzer::SiPixelLorentzAngle::tsTransform
private

Definition at line 188 of file SiPixelLorentzAngle.h.

◆ usedHitCounter_

int analyzer::SiPixelLorentzAngle::usedHitCounter_
private

Definition at line 178 of file SiPixelLorentzAngle.h.

Referenced by analyze(), beginJob(), and endJob().

◆ width_

double analyzer::SiPixelLorentzAngle::width_
private

Definition at line 158 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().