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::EDAnalyzer 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, 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
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices 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_
 
const MagneticFieldmagfield
 
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
 
const TrackerGeometrytracker
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
int trackEventsCounter_
 
Hit trackhit_
 
Hit trackhitF_
 
TrajectoryStateTransform tsTransform
 
int usedHitCounter_
 
double width_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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<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)
 

Detailed Description

Definition at line 83 of file SiPixelLorentzAngle.h.

Constructor & Destructor Documentation

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

Definition at line 40 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, and width_.

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

Definition at line 69 of file SiPixelLorentzAngle.cc.

69 {}

Member Function Documentation

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

Definition at line 184 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, LEDCalibrationChannels::depth, diskF_, flavorHistoryFilter_cfi::dr, shallow::drift(), PVValHelper::dx, PVValHelper::dy, edm::AssociationMap< Tag >::empty(), edm::AssociationMap< Tag >::end(), reco::TrackBase::eta(), eta_, edm::EventID::event(), event_, event_counter_, HcalObjRepresent::Fill(), fillPix(), Hit::gamma, edm::EventSetup::get(), edm::Event::getByToken(), h_cluster_shape_adc_, h_cluster_shape_adc_rot_, h_cluster_shape_noadc_, h_cluster_shape_noadc_rot_, h_tracks_, hitCounter_, edm::EventBase::id(), TrackerGeometry::idToDet(), isflipped_, TrajectoryStateOnSurface::isValid(), 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(), reco::TrackBase::phi(), phi_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, pixelTracksCounter_, pixinfo_, pixinfoF_, edm::ESHandle< T >::product(), reco::TrackBase::pt(), 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, edm::EventID::run(), run_, sideF_, simData_, simhit_, simhitF_, SiPixelLorentzAngleTree_, SiPixelLorentzAngleTreeForward_, Clust::size_x, Clust::size_y, PixelGeomDetUnit::specificTopology(), GeomDet::surface(), t_trajTrack, funct::tan(), Surface::toGlobal(), HLT_2018_cff::track, DetId::Tracker, tracker, trackerHitAssociatorConfig_, trackEventsCounter_, trackhit_, trackhitF_, usedHitCounter_, width_, Pixinfo::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().

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

Reimplemented from edm::EDAnalyzer.

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  // edm::ESHandle<TrackerGeometry> estracker; //this block should not be in beginJob()
179  // c.get<TrackerDigiGeometryRecord>().get(estracker);
180  // tracker=&(* estracker);
181 }
std::map< int, TH2F * > _h_drift_depth_adc2_
float adc[maxpix]
std::map< int, TH2F * > _h_drift_depth_
float row[maxpix]
std::map< int, TH2F * > _h_drift_depth_noadc_
std::map< int, TH2F * > _h_drift_depth_adc_
std::map< int, TH1F * > _h_mean_
float x[maxpix]
float col[maxpix]
float y[maxpix]
void SiPixelLorentzAngle::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 476 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_, _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, _h_mean_, hltPixelTracks_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_, p1, pixelTracksCounter_, TtFullHadEvtBuilder_cfi::prob, trackEventsCounter_, pileupReCalc_HLTpaths::trunc, and usedHitCounter_.

Referenced by o2olib.O2ORunMgr::executeJob().

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

Definition at line 556 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().

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

Definition at line 574 of file SiPixelLorentzAngle.cc.

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

Referenced by endJob().

574  {
575  double nentries = 0;
576 
577  h_drift_depth_adc_slice_->Reset("ICE");
578 
579  // determine sigma and sigma^2 of the adc counts and average adc counts
580  //loop over bins in drift width
581  for (int j = 1; j <= hist_drift_; j++) {
582  if (_h_drift_depth_noadc_[i_ring]->GetBinContent(j, i) >= 1) {
583  double adc_error2 =
584  (_h_drift_depth_adc2_[i_ring]->GetBinContent(j, i) - _h_drift_depth_adc_[i_ring]->GetBinContent(j, i) *
585  _h_drift_depth_adc_[i_ring]->GetBinContent(j, i) /
586  _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i)) /
587  _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i);
588  _h_drift_depth_adc_[i_ring]->SetBinError(j, i, sqrt(adc_error2));
589  double error2 = adc_error2 / (_h_drift_depth_noadc_[i_ring]->GetBinContent(j, i) - 1.);
590  _h_drift_depth_[i_ring]->SetBinError(j, i, sqrt(error2));
591  } else {
592  _h_drift_depth_[i_ring]->SetBinError(j, i, 0);
593  _h_drift_depth_adc_[i_ring]->SetBinError(j, i, 0);
594  }
595  h_drift_depth_adc_slice_->SetBinContent(j, _h_drift_depth_adc_[i_ring]->GetBinContent(j, i));
596  h_drift_depth_adc_slice_->SetBinError(j, _h_drift_depth_adc_[i_ring]->GetBinError(j, i));
597  nentries += _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i);
598  } // end loop over bins in drift width
599 
600  double mean = h_drift_depth_adc_slice_->GetMean(1);
601  double error = 0;
602  if (nentries != 0) {
603  error = h_drift_depth_adc_slice_->GetRMS(1) / sqrt(nentries);
604  }
605 
606  _h_mean_[i_ring]->SetBinContent(i, mean);
607  _h_mean_[i_ring]->SetBinError(i, error);
608 }
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

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

Definition at line 168 of file SiPixelLorentzAngle.h.

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

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

Definition at line 166 of file SiPixelLorentzAngle.h.

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

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

Definition at line 165 of file SiPixelLorentzAngle.h.

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

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

Definition at line 167 of file SiPixelLorentzAngle.h.

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

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

Definition at line 170 of file SiPixelLorentzAngle.h.

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

int analyzer::SiPixelLorentzAngle::bladeF_
private

Definition at line 124 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double analyzer::SiPixelLorentzAngle::chi2_
private

Definition at line 112 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double analyzer::SiPixelLorentzAngle::chi2F_
private

Definition at line 130 of file SiPixelLorentzAngle.h.

Clust analyzer::SiPixelLorentzAngle::clust_
private

Definition at line 116 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double analyzer::SiPixelLorentzAngle::clustChargeMax_
private

Definition at line 145 of file SiPixelLorentzAngle.h.

Referenced by analyze().

Clust analyzer::SiPixelLorentzAngle::clustF_
private

Definition at line 134 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int analyzer::SiPixelLorentzAngle::clustSizeYMin_
private

Definition at line 143 of file SiPixelLorentzAngle.h.

Referenced by analyze().

int analyzer::SiPixelLorentzAngle::diskF_
private

Definition at line 123 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float analyzer::SiPixelLorentzAngle::eta_
private

Definition at line 110 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float analyzer::SiPixelLorentzAngle::etaF_
private

Definition at line 128 of file SiPixelLorentzAngle.h.

int analyzer::SiPixelLorentzAngle::event_
private

Definition at line 104 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int analyzer::SiPixelLorentzAngle::event_counter_
private

Definition at line 179 of file SiPixelLorentzAngle.h.

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

int analyzer::SiPixelLorentzAngle::eventF_
private

Definition at line 121 of file SiPixelLorentzAngle.h.

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

Definition at line 138 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

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

Definition at line 139 of file SiPixelLorentzAngle.h.

Referenced by endJob().

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_
private

Definition at line 173 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_adc_
private

Definition at line 171 of file SiPixelLorentzAngle.h.

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

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_adc_rot_
private

Definition at line 174 of file SiPixelLorentzAngle.h.

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

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_noadc_
private

Definition at line 172 of file SiPixelLorentzAngle.h.

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

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_noadc_rot_
private

Definition at line 175 of file SiPixelLorentzAngle.h.

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

TH2F* analyzer::SiPixelLorentzAngle::h_cluster_shape_rot_
private

Definition at line 176 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

TH1F* analyzer::SiPixelLorentzAngle::h_drift_depth_adc_slice_
private

Definition at line 169 of file SiPixelLorentzAngle.h.

Referenced by endJob(), and findMean().

TH1F* analyzer::SiPixelLorentzAngle::h_tracks_
private

Definition at line 177 of file SiPixelLorentzAngle.h.

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

TFile* analyzer::SiPixelLorentzAngle::hFile_
private

Definition at line 98 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and endJob().

int analyzer::SiPixelLorentzAngle::hist_depth_
private

Definition at line 146 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and endJob().

int analyzer::SiPixelLorentzAngle::hist_drift_
private

Definition at line 147 of file SiPixelLorentzAngle.h.

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

int analyzer::SiPixelLorentzAngle::hist_x_
private

Definition at line 153 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

int analyzer::SiPixelLorentzAngle::hist_y_
private

Definition at line 154 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

int analyzer::SiPixelLorentzAngle::hitCounter_
private

Definition at line 179 of file SiPixelLorentzAngle.h.

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

int analyzer::SiPixelLorentzAngle::isflipped_
private

Definition at line 108 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int analyzer::SiPixelLorentzAngle::ladder_
private

Definition at line 106 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int analyzer::SiPixelLorentzAngle::layer_
private

Definition at line 107 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

const MagneticField* analyzer::SiPixelLorentzAngle::magfield
private

Definition at line 190 of file SiPixelLorentzAngle.h.

double analyzer::SiPixelLorentzAngle::max_depth_
private

Definition at line 161 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double analyzer::SiPixelLorentzAngle::max_drift_
private

Definition at line 163 of file SiPixelLorentzAngle.h.

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

double analyzer::SiPixelLorentzAngle::max_x_
private

Definition at line 156 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double analyzer::SiPixelLorentzAngle::max_y_
private

Definition at line 158 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double analyzer::SiPixelLorentzAngle::min_depth_
private

Definition at line 160 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double analyzer::SiPixelLorentzAngle::min_drift_
private

Definition at line 162 of file SiPixelLorentzAngle.h.

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

double analyzer::SiPixelLorentzAngle::min_x_
private

Definition at line 155 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double analyzer::SiPixelLorentzAngle::min_y_
private

Definition at line 157 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

int analyzer::SiPixelLorentzAngle::module_
private

Definition at line 105 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int analyzer::SiPixelLorentzAngle::moduleF_
private

Definition at line 126 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double analyzer::SiPixelLorentzAngle::ndof_
private

Definition at line 113 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double analyzer::SiPixelLorentzAngle::ndofF_
private

Definition at line 131 of file SiPixelLorentzAngle.h.

double analyzer::SiPixelLorentzAngle::normChi2Max_
private

Definition at line 142 of file SiPixelLorentzAngle.h.

Referenced by analyze().

int analyzer::SiPixelLorentzAngle::panelF_
private

Definition at line 125 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float analyzer::SiPixelLorentzAngle::phi_
private

Definition at line 111 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float analyzer::SiPixelLorentzAngle::phiF_
private

Definition at line 129 of file SiPixelLorentzAngle.h.

int analyzer::SiPixelLorentzAngle::pixelTracksCounter_
private

Definition at line 179 of file SiPixelLorentzAngle.h.

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

Pixinfo analyzer::SiPixelLorentzAngle::pixinfo_
private

Definition at line 114 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Pixinfo analyzer::SiPixelLorentzAngle::pixinfoF_
private

Definition at line 132 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float analyzer::SiPixelLorentzAngle::pt_
private

Definition at line 109 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float analyzer::SiPixelLorentzAngle::ptF_
private

Definition at line 127 of file SiPixelLorentzAngle.h.

double analyzer::SiPixelLorentzAngle::ptmin_
private

Definition at line 140 of file SiPixelLorentzAngle.h.

Referenced by analyze().

Rechit analyzer::SiPixelLorentzAngle::rechit_
private

Definition at line 117 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Rechit analyzer::SiPixelLorentzAngle::rechitF_
private

Definition at line 135 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double analyzer::SiPixelLorentzAngle::residualMax_
private

Definition at line 144 of file SiPixelLorentzAngle.h.

Referenced by analyze().

const TransientTrackingRecHitBuilder* analyzer::SiPixelLorentzAngle::RHBuilder
private

Definition at line 186 of file SiPixelLorentzAngle.h.

int analyzer::SiPixelLorentzAngle::run_
private

Definition at line 103 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int analyzer::SiPixelLorentzAngle::runF_
private

Definition at line 120 of file SiPixelLorentzAngle.h.

int analyzer::SiPixelLorentzAngle::sideF_
private

Definition at line 122 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

bool analyzer::SiPixelLorentzAngle::simData_
private

Definition at line 141 of file SiPixelLorentzAngle.h.

Referenced by analyze().

Hit analyzer::SiPixelLorentzAngle::simhit_
private

Definition at line 115 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Hit analyzer::SiPixelLorentzAngle::simhitF_
private

Definition at line 133 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

TTree* analyzer::SiPixelLorentzAngle::SiPixelLorentzAngleTree_
private

Definition at line 99 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

TTree* analyzer::SiPixelLorentzAngle::SiPixelLorentzAngleTreeForward_
private

Definition at line 100 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

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

Definition at line 192 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().

Chi2MeasurementEstimator* analyzer::SiPixelLorentzAngle::theEstimator
private

Definition at line 185 of file SiPixelLorentzAngle.h.

const KFTrajectoryFitter* analyzer::SiPixelLorentzAngle::theFitter
private

Definition at line 188 of file SiPixelLorentzAngle.h.

PropagatorWithMaterial* analyzer::SiPixelLorentzAngle::thePropagator
private

Definition at line 182 of file SiPixelLorentzAngle.h.

PropagatorWithMaterial* analyzer::SiPixelLorentzAngle::thePropagatorOp
private

Definition at line 183 of file SiPixelLorentzAngle.h.

const KFTrajectorySmoother* analyzer::SiPixelLorentzAngle::theSmoother
private

Definition at line 187 of file SiPixelLorentzAngle.h.

KFUpdator* analyzer::SiPixelLorentzAngle::theUpdator
private

Definition at line 184 of file SiPixelLorentzAngle.h.

const TrackerGeometry* analyzer::SiPixelLorentzAngle::tracker
private

Definition at line 189 of file SiPixelLorentzAngle.h.

Referenced by analyze().

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

Definition at line 150 of file SiPixelLorentzAngle.h.

Referenced by analyze().

int analyzer::SiPixelLorentzAngle::trackEventsCounter_
private

Definition at line 179 of file SiPixelLorentzAngle.h.

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

Hit analyzer::SiPixelLorentzAngle::trackhit_
private

Definition at line 115 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Hit analyzer::SiPixelLorentzAngle::trackhitF_
private

Definition at line 133 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

TrajectoryStateTransform analyzer::SiPixelLorentzAngle::tsTransform
private

Definition at line 191 of file SiPixelLorentzAngle.h.

int analyzer::SiPixelLorentzAngle::usedHitCounter_
private

Definition at line 179 of file SiPixelLorentzAngle.h.

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

double analyzer::SiPixelLorentzAngle::width_
private

Definition at line 159 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().