CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelLorentzAngle Class Reference

#include <SiPixelLorentzAngle.h>

Inheritance diagram for SiPixelLorentzAngle:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
virtual void beginJob ()
 
virtual void endJob ()
 
float getLorentzAngle (const uint32_t &) const
 
const std::map< unsigned int,
float > & 
getLorentzAngles () const
 
void putLorentsAngles (std::map< unsigned int, float > &LA)
 
bool putLorentzAngle (const uint32_t &, float &)
 
 SiPixelLorentzAngle ()
 
 SiPixelLorentzAngle (const edm::ParameterSet &conf)
 
 ~SiPixelLorentzAngle ()
 
virtual ~SiPixelLorentzAngle ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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_
 
edm::ParameterSet conf_
 
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_
 
std::map< unsigned int, float > m_LA
 
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
TransientTrackingRecHitBuilder
RHBuilder
 
int run_
 
int runF_
 
int sideF_
 
bool simData_
 
Hit simhit_
 
Hit simhitF_
 
TTree * SiPixelLorentzAngleTree_
 
TTree * SiPixelLorentzAngleTreeForward_
 
edm::EDGetTokenT
< TrajTrackAssociationCollection
t_trajTrack
 
Chi2MeasurementEstimatortheEstimator
 
const KFTrajectoryFittertheFitter
 
PropagatorWithMaterialthePropagator
 
PropagatorWithMaterialthePropagatorOp
 
const KFTrajectorySmoothertheSmoother
 
KFUpdatortheUpdator
 
const TrackerGeometrytracker
 
int trackEventsCounter_
 
Hit trackhit_
 
Hit trackhitF_
 
TrajectoryStateTransform tsTransform
 
int usedHitCounter_
 
double width_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 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 86 of file SiPixelLorentzAngle.h.

Constructor & Destructor Documentation

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

Definition at line 36 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_.

36  :
37  conf_(conf), filename_(conf.getParameter<std::string>("fileName")), filenameFit_(conf.getParameter<std::string>("fileNameFit")), ptmin_(conf.getParameter<double>("ptMin")), simData_(conf.getParameter<bool>("simData")), normChi2Max_(conf.getParameter<double>("normChi2Max")), clustSizeYMin_(conf.getParameter<int>("clustSizeYMin")), residualMax_(conf.getParameter<double>("residualMax")), clustChargeMax_(conf.getParameter<double>("clustChargeMax")),hist_depth_(conf.getParameter<int>("binsDepth")), hist_drift_(conf.getParameter<int>("binsDrift"))
38 {
39  // anglefinder_=new TrackLocalAngle(conf);
40  hist_x_ = 50;
41  hist_y_ = 100;
42  min_x_ = -500.;
43  max_x_ = 500.;
44  min_y_ = -1500.;
45  max_y_ = 500.;
46  width_ = 0.0285;
47  min_depth_ = -100.;
48  max_depth_ = 400.;
49  min_drift_ = -1000.; //-200.;(conf.getParameter<double>("residualMax"))
50  max_drift_ = 1000.; //400.;
51 
52  t_trajTrack = consumes<TrajTrackAssociationCollection> (conf.getParameter<edm::InputTag>("src"));
53 
54 }
T getParameter(std::string const &) const
edm::ParameterSet conf_
edm::EDGetTokenT< TrajTrackAssociationCollection > t_trajTrack
SiPixelLorentzAngle::~SiPixelLorentzAngle ( )
virtual

Definition at line 57 of file SiPixelLorentzAngle.cc.

57 { }
SiPixelLorentzAngle::SiPixelLorentzAngle ( )
inline

Definition at line 14 of file SiPixelLorentzAngle.h.

14 {};
SiPixelLorentzAngle::~SiPixelLorentzAngle ( )
inline

Definition at line 15 of file SiPixelLorentzAngle.h.

15 {};

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 152 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, Pixinfo::adc, Hit::alpha, TrackerHitAssociator::associateHit(), Hit::beta, bladeF_, Clust::charge, chi2_, Trajectory::chiSquared(), clust_, clustChargeMax_, clustF_, clustSizeYMin_, Pixinfo::col, edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, gather_cfg::cout, diskF_, shallow::drift(), 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(), j, ladder_, layer_, TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localPosition(), 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< class >::product(), reco::TrackBase::pt(), pt_, ptmin_, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), TrackerTopology::pxfSide(), 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(), DetId::Tracker, tracker, trackEventsCounter_, trackhit_, trackhitF_, usedHitCounter_, width_, x, Pixinfo::x, Hit::x, PV3DBase< T, PVType, FrameType >::x(), Clust::x, Rechit::x, detailsBasic3DVector::y, Pixinfo::y, Hit::y, PV3DBase< T, PVType, FrameType >::y(), Clust::y, Rechit::y, and PV3DBase< T, PVType, FrameType >::z().

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

Reimplemented from edm::EDAnalyzer.

Definition at line 59 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_, mergeVDriftHistosByStation::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.

60 {
61 
62  // cout << "started SiPixelLorentzAngle" << endl;
63  hFile_ = new TFile (filename_.c_str(), "RECREATE" );
64  int bufsize = 64000;
65  // create tree structure
66  SiPixelLorentzAngleTree_ = new TTree("SiPixelLorentzAngleTree_","SiPixel LorentzAngle tree", bufsize);
67  SiPixelLorentzAngleTree_->Branch("run", &run_, "run/I", bufsize);
68  SiPixelLorentzAngleTree_->Branch("event", &event_, "event/I", bufsize);
69  SiPixelLorentzAngleTree_->Branch("module", &module_, "module/I", bufsize);
70  SiPixelLorentzAngleTree_->Branch("ladder", &ladder_, "ladder/I", bufsize);
71  SiPixelLorentzAngleTree_->Branch("layer", &layer_, "layer/I", bufsize);
72  SiPixelLorentzAngleTree_->Branch("isflipped", &isflipped_, "isflipped/I", bufsize);
73  SiPixelLorentzAngleTree_->Branch("pt", &pt_, "pt/F", bufsize);
74  SiPixelLorentzAngleTree_->Branch("eta", &eta_, "eta/F", bufsize);
75  SiPixelLorentzAngleTree_->Branch("phi", &phi_, "phi/F", bufsize);
76  SiPixelLorentzAngleTree_->Branch("chi2", &chi2_, "chi2/D", bufsize);
77  SiPixelLorentzAngleTree_->Branch("ndof", &ndof_, "ndof/D", bufsize);
78  SiPixelLorentzAngleTree_->Branch("trackhit", &trackhit_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
79  SiPixelLorentzAngleTree_->Branch("simhit", &simhit_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
80  SiPixelLorentzAngleTree_->Branch("npix", &pixinfo_.npix, "npix/I", bufsize);
81  SiPixelLorentzAngleTree_->Branch("rowpix", pixinfo_.row, "row[npix]/F", bufsize);
82  SiPixelLorentzAngleTree_->Branch("colpix", pixinfo_.col, "col[npix]/F", bufsize);
83  SiPixelLorentzAngleTree_->Branch("adc", pixinfo_.adc, "adc[npix]/F", bufsize);
84  SiPixelLorentzAngleTree_->Branch("xpix", pixinfo_.x, "x[npix]/F", bufsize);
85  SiPixelLorentzAngleTree_->Branch("ypix", pixinfo_.y, "y[npix]/F", bufsize);
86  SiPixelLorentzAngleTree_->Branch("clust", &clust_, "x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I", bufsize);
87  SiPixelLorentzAngleTree_->Branch("rechit", &rechit_, "x/F:y/F", bufsize);
88 
89  SiPixelLorentzAngleTreeForward_ = new TTree("SiPixelLorentzAngleTreeForward_","SiPixel LorentzAngle tree forward", bufsize);
90  SiPixelLorentzAngleTreeForward_->Branch("run", &run_, "run/I", bufsize);
91  SiPixelLorentzAngleTreeForward_->Branch("event", &event_, "event/I", bufsize);
92  SiPixelLorentzAngleTreeForward_->Branch("side", &sideF_, "side/I", bufsize);
93  SiPixelLorentzAngleTreeForward_->Branch("disk", &diskF_, "disk/I", bufsize);
94  SiPixelLorentzAngleTreeForward_->Branch("blade", &bladeF_, "blade/I", bufsize);
95  SiPixelLorentzAngleTreeForward_->Branch("panel", &panelF_, "panel/I", bufsize);
96  SiPixelLorentzAngleTreeForward_->Branch("module", &moduleF_, "module/I", bufsize);
97  SiPixelLorentzAngleTreeForward_->Branch("pt", &pt_, "pt/F", bufsize);
98  SiPixelLorentzAngleTreeForward_->Branch("eta", &eta_, "eta/F", bufsize);
99  SiPixelLorentzAngleTreeForward_->Branch("phi", &phi_, "phi/F", bufsize);
100  SiPixelLorentzAngleTreeForward_->Branch("chi2", &chi2_, "chi2/D", bufsize);
101  SiPixelLorentzAngleTreeForward_->Branch("ndof", &ndof_, "ndof/D", bufsize);
102  SiPixelLorentzAngleTreeForward_->Branch("trackhit", &trackhitF_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
103  SiPixelLorentzAngleTreeForward_->Branch("simhit", &simhitF_, "x/F:y/F:alpha/D:beta/D:gamma_/D", bufsize);
104  SiPixelLorentzAngleTreeForward_->Branch("npix", &pixinfoF_.npix, "npix/I", bufsize);
105  SiPixelLorentzAngleTreeForward_->Branch("rowpix", pixinfoF_.row, "row[npix]/F", bufsize);
106  SiPixelLorentzAngleTreeForward_->Branch("colpix", pixinfoF_.col, "col[npix]/F", bufsize);
107  SiPixelLorentzAngleTreeForward_->Branch("adc", pixinfoF_.adc, "adc[npix]/F", bufsize);
108  SiPixelLorentzAngleTreeForward_->Branch("xpix", pixinfoF_.x, "x[npix]/F", bufsize);
109  SiPixelLorentzAngleTreeForward_->Branch("ypix", pixinfoF_.y, "y[npix]/F", bufsize);
110  SiPixelLorentzAngleTreeForward_->Branch("clust", &clustF_, "x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I", bufsize);
111  SiPixelLorentzAngleTreeForward_->Branch("rechit", &rechitF_, "x/F:y/F", bufsize);
112 
113 
114  //book histograms
115  char name[128];
116  for(int i_module = 1; i_module<=8; i_module++){
117  for(int i_layer = 1; i_layer<=3; i_layer++){
118  sprintf(name, "h_drift_depth_adc_layer%i_module%i", i_layer, i_module);
119  _h_drift_depth_adc_[i_module + (i_layer -1) * 8] = new TH2F(name,name,hist_drift_ , min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
120  sprintf(name, "h_drift_depth_adc2_layer%i_module%i", i_layer, i_module);
121  _h_drift_depth_adc2_[i_module + (i_layer -1) * 8] = new TH2F(name,name,hist_drift_ , min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
122  sprintf(name, "h_drift_depth_noadc_layer%i_module%i", i_layer, i_module);
123  _h_drift_depth_noadc_[i_module + (i_layer -1) * 8] = new TH2F(name,name,hist_drift_ , min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
124  sprintf(name, "h_drift_depth_layer%i_module%i", i_layer, i_module);
125  _h_drift_depth_[i_module + (i_layer -1) * 8] = new TH2F(name,name,hist_drift_ , min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
126  sprintf(name, "h_mean_layer%i_module%i", i_layer, i_module);
127  _h_mean_[i_module + (i_layer -1) * 8] = new TH1F(name,name,hist_depth_, min_depth_, max_depth_);
128  }
129  }
130 
131  // just for some expaining plots
132  h_cluster_shape_adc_ = new TH2F("h_cluster_shape_adc","cluster shape with adc weight", hist_x_, min_x_, max_x_, hist_y_, min_y_, max_y_);
133  h_cluster_shape_noadc_ = new TH2F("h_cluster_shape_noadc","cluster shape without adc weight", hist_x_, min_x_, max_x_, hist_y_, min_y_, max_y_);
134  h_cluster_shape_ = new TH2F("h_cluster_shape","cluster shape", hist_x_, min_x_, max_x_, hist_y_, min_y_, max_y_);
135  h_cluster_shape_adc_rot_ = new TH2F("h_cluster_shape_adc_rot","cluster shape with adc weight", hist_x_, min_x_, max_x_, hist_y_, -max_y_, -min_y_);
136  h_cluster_shape_noadc_rot_ = new TH2F("h_cluster_shape_noadc_rot","cluster shape without adc weight", hist_x_, min_x_, max_x_, hist_y_, -max_y_, -min_y_);
137  h_cluster_shape_rot_ = new TH2F("h_cluster_shape_rot","cluster shape", hist_x_, min_x_, max_x_, hist_y_, -max_y_, -min_y_);
138  h_tracks_ = new TH1F("h_tracks","h_tracks",2,0.,2.);
139  event_counter_ = 0;
141  // trackcounter_ = 0;
142  hitCounter_ = 0;
143  usedHitCounter_ = 0;
145 // edm::ESHandle<TrackerGeometry> estracker; //this block should not be in beginJob()
146 // c.get<TrackerDigiGeometryRecord>().get(estracker);
147 // tracker=&(* estracker);
148 }
float adc[maxpix]
std::map< int, TH2F * > _h_drift_depth_adc_
float row[maxpix]
std::map< int, TH2F * > _h_drift_depth_noadc_
std::map< int, TH2F * > _h_drift_depth_
float x[maxpix]
float col[maxpix]
std::map< int, TH2F * > _h_drift_depth_adc2_
std::map< int, TH1F * > _h_mean_
float y[maxpix]
void SiPixelLorentzAngle::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 433 of file SiPixelLorentzAngle.cc.

References _h_drift_depth_, _h_drift_depth_adc2_, _h_drift_depth_adc_, _h_drift_depth_noadc_, _h_mean_, gather_cfg::cout, reco::e1, event_counter_, python.connectstrParser::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_, i, max_drift_, min_drift_, p1, pixelTracksCounter_, mix_2012_Summer_inTimeOnly_cff::prob, trackEventsCounter_, estimatePileup_makeJSON::trunc, and usedHitCounter_.

434 {
435  // produce histograms with the average adc counts
436  for(int i_ring = 1; i_ring<=24; i_ring++){
437  _h_drift_depth_[i_ring]->Divide(_h_drift_depth_adc_[i_ring], _h_drift_depth_noadc_[i_ring]);
438  }
439 
440  h_drift_depth_adc_slice_ = new TH1F("h_drift_depth_adc_slice", "slice of adc histogram", hist_drift_ , min_drift_, max_drift_);
441 
442  TF1 *f1 = new TF1("f1","[0] + [1]*x",50., 235.);
443  f1->SetParName(0,"p0");
444  f1->SetParName(1,"p1");
445  f1->SetParameter(0,0);
446  f1->SetParameter(1,0.4);
447  ofstream fLorentzFit( filenameFit_.c_str(), ios::trunc );
448  cout.precision( 4 );
449  fLorentzFit << "module" << "\t" << "layer" << "\t" << "offset" << "\t" << "error" << "\t" << "slope" << "\t" << "error" << "\t" "rel.err" << "\t" "pull" << "\t" << "chi2" << "\t" << "prob" << endl;
450  //loop over modlues and layers to fit the lorentz angle
451  for( int i_layer = 1; i_layer<=3; i_layer++){
452  for(int i_module = 1; i_module<=8; i_module++){
453  //loop over bins in depth (z-local-coordinate) (in order to fit slices)
454  for( int i = 1; i <= hist_depth_; i++){
455  findMean(i, (i_module + (i_layer - 1) * 8));
456  }// end loop over bins in depth
457  _h_mean_[i_module + (i_layer - 1) * 8]->Fit(f1,"ERQ");
458  double p0 = f1->GetParameter(0);
459  double e0 = f1->GetParError(0);
460  double p1 = f1->GetParameter(1);
461  double e1 = f1->GetParError(1);
462  double chi2 = f1->GetChisquare();
463  double prob = f1->GetProb();
464  fLorentzFit << setprecision( 4 ) << i_module << "\t" << i_layer << "\t" << p0 << "\t" << e0 << "\t" << p1 << setprecision( 3 ) << "\t" << e1 << "\t" << e1 / p1 *100. << "\t"<< (p1 - 0.424) / e1 << "\t"<< chi2 << "\t" << prob << endl;
465  }
466  } // end loop over modules and layers
467  fLorentzFit.close();
468  hFile_->cd();
469  for(int i_module = 1; i_module<=8; i_module++){
470  for(int i_layer = 1; i_layer<=3; i_layer++){
471  _h_drift_depth_adc_[i_module + (i_layer -1) * 8]->Write();
472  _h_drift_depth_adc2_[i_module + (i_layer -1) * 8]->Write();
473  _h_drift_depth_noadc_[i_module + (i_layer -1) * 8]->Write();
474  _h_drift_depth_[i_module + (i_layer -1) * 8]->Write();
475  _h_mean_[i_module + (i_layer -1) * 8]->Write();
476  }
477  }
478  h_cluster_shape_adc_->Write();
479  h_cluster_shape_noadc_->Write();
480  h_cluster_shape_adc_rot_->Write();
482  h_tracks_->Write();
483 
484  hFile_->Write();
485  hFile_->Close();
486  cout << "events: " << event_counter_ << endl;
487  cout << "events with tracks: " << trackEventsCounter_ << endl;
488  cout << "events with pixeltracks: " << pixelTracksCounter_ << endl;
489  cout << "hits in the pixel: " << hitCounter_ << endl;
490  cout << "number of used Hits: " << usedHitCounter_ << endl;
491 }
int i
Definition: DBlmapReader.cc:9
std::map< int, TH2F * > _h_drift_depth_adc_
std::map< int, TH2F * > _h_drift_depth_noadc_
std::map< int, TH2F * > _h_drift_depth_
Definition: Fit.h:34
Float e1
Definition: deltaR.h:22
double p1[4]
Definition: TauolaWrapper.h:89
std::map< int, TH2F * > _h_drift_depth_adc2_
tuple cout
Definition: gather_cfg.py:121
void findMean(int i, int i_ring)
std::map< int, TH1F * > _h_mean_
void SiPixelLorentzAngle::fillPix ( const SiPixelCluster LocPix,
const PixelTopology topol,
Pixinfo pixinfo 
)
inlineprivate

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

495 {
496  const std::vector<SiPixelCluster::Pixel>& pixvector = LocPix.pixels();
497  pixinfo.npix = 0;
498  for(std::vector<SiPixelCluster::Pixel>::const_iterator itPix = pixvector.begin(); itPix != pixvector.end(); itPix++){
499  // for(pixinfo.npix = 0; pixinfo.npix < static_cast<int>(pixvector.size()); ++pixinfo.npix) {
500  pixinfo.row[pixinfo.npix] = itPix->x;
501  pixinfo.col[pixinfo.npix] = itPix->y;
502  pixinfo.adc[pixinfo.npix] = itPix->adc;
503  LocalPoint lp = topol->localPosition(MeasurementPoint(itPix->x + 0.5, itPix->y+0.5));
504  pixinfo.x[pixinfo.npix] = lp.x();
505  pixinfo.y[pixinfo.npix]= lp.y();
506  pixinfo.npix++;
507  }
508 }
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
float adc[maxpix]
T y() const
Definition: PV3DBase.h:63
float row[maxpix]
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
float x[maxpix]
float col[maxpix]
T x() const
Definition: PV3DBase.h:62
const std::vector< Pixel > pixels() const
float y[maxpix]
void SiPixelLorentzAngle::findMean ( int  i,
int  i_ring 
)
private

Definition at line 510 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_, j, timingPdfMaker::mean, and mathSSE::sqrt().

Referenced by endJob().

511 {
512  double nentries = 0;
513 
514  h_drift_depth_adc_slice_->Reset("ICE");
515 
516  // determine sigma and sigma^2 of the adc counts and average adc counts
517  //loop over bins in drift width
518  for( int j = 1; j<= hist_drift_; j++){
519  if(_h_drift_depth_noadc_[i_ring]->GetBinContent(j, i) >= 1){
520  double adc_error2 = (_h_drift_depth_adc2_[i_ring]->GetBinContent(j,i) - _h_drift_depth_adc_[i_ring]->GetBinContent(j,i)*_h_drift_depth_adc_[i_ring]->GetBinContent(j, i) / _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i)) / _h_drift_depth_noadc_[i_ring]->GetBinContent(j, i);
521  _h_drift_depth_adc_[i_ring]->SetBinError(j, i, sqrt(adc_error2));
522  double error2 = adc_error2 / (_h_drift_depth_noadc_[i_ring]->GetBinContent(j,i) - 1.);
523  _h_drift_depth_[i_ring]->SetBinError(j,i,sqrt(error2));
524  }
525  else{
526  _h_drift_depth_[i_ring]->SetBinError(j,i,0);
527  _h_drift_depth_adc_[i_ring]->SetBinError(j, i, 0);
528  }
529  h_drift_depth_adc_slice_->SetBinContent(j, _h_drift_depth_adc_[i_ring]->GetBinContent(j,i));
530  h_drift_depth_adc_slice_->SetBinError(j, _h_drift_depth_adc_[i_ring]->GetBinError(j,i));
531  nentries += _h_drift_depth_noadc_[i_ring]->GetBinContent(j,i);
532  } // end loop over bins in drift width
533 
534  double mean = h_drift_depth_adc_slice_->GetMean(1);
535  double error = 0;
536  if(nentries != 0){
537  error = h_drift_depth_adc_slice_->GetRMS(1) / sqrt(nentries);
538  }
539 
540  _h_mean_[i_ring]->SetBinContent(i, mean);
541  _h_mean_[i_ring]->SetBinError(i, error);
542 
543 }
int i
Definition: DBlmapReader.cc:9
std::map< int, TH2F * > _h_drift_depth_adc_
std::map< int, TH2F * > _h_drift_depth_noadc_
std::map< int, TH2F * > _h_drift_depth_
T sqrt(T t)
Definition: SSEVec.h:48
int j
Definition: DBlmapReader.cc:9
std::map< int, TH2F * > _h_drift_depth_adc2_
std::map< int, TH1F * > _h_mean_
float SiPixelLorentzAngle::getLorentzAngle ( const uint32_t &  detid) const

Definition at line 13 of file SiPixelLorentzAngle.cc.

References m_LA.

Referenced by PixelCPEBase::driftDirection().

13  {
14  std::map<unsigned int,float>::const_iterator id=m_LA.find(detid);
15  if(id!=m_LA.end()) return id->second;
16  else {
17  edm::LogError("SiPixelLorentzAngle") << "SiPixelLorentzAngle for DetID " << detid << " is not stored" << std::endl;
18  }
19  return 0;
20 }
std::map< unsigned int, float > m_LA
const std::map<unsigned int,float>& SiPixelLorentzAngle::getLorentzAngles ( ) const
inline
void SiPixelLorentzAngle::putLorentsAngles ( std::map< unsigned int, float > &  LA)
inline

Definition at line 17 of file SiPixelLorentzAngle.h.

References m_LA.

17 {m_LA=LA;}
std::map< unsigned int, float > m_LA
bool SiPixelLorentzAngle::putLorentzAngle ( const uint32_t &  detid,
float &  value 
)

Definition at line 4 of file SiPixelLorentzAngle.cc.

References cond::rpcobgas::detid, m_LA, and relativeConstraints::value.

Referenced by SiPixelLorentzAngleDB::analyze(), SiPixelLorentzAngleCalibration::createFromTree(), and SiPixelLorentzAngleCalibration::endOfJob().

4  {
5  std::map<unsigned int,float>::const_iterator id=m_LA.find(detid);
6  if(id!=m_LA.end()){
7  edm::LogError("SiPixelLorentzAngle") << "SiPixelLorentzAngle for DetID " << detid << " is already stored. Skippig this put" << std::endl;
8  return false;
9  }
10  else m_LA[detid]=value;
11  return true;
12 }
std::map< unsigned int, float > m_LA

Member Data Documentation

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

Definition at line 173 of file SiPixelLorentzAngle.h.

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

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

Definition at line 171 of file SiPixelLorentzAngle.h.

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

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

Definition at line 170 of file SiPixelLorentzAngle.h.

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

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

Definition at line 172 of file SiPixelLorentzAngle.h.

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

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

Definition at line 175 of file SiPixelLorentzAngle.h.

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

int SiPixelLorentzAngle::bladeF_
private

Definition at line 131 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double SiPixelLorentzAngle::chi2_
private

Definition at line 119 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double SiPixelLorentzAngle::chi2F_
private

Definition at line 137 of file SiPixelLorentzAngle.h.

Clust SiPixelLorentzAngle::clust_
private

Definition at line 123 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double SiPixelLorentzAngle::clustChargeMax_
private

Definition at line 153 of file SiPixelLorentzAngle.h.

Referenced by analyze().

Clust SiPixelLorentzAngle::clustF_
private

Definition at line 141 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int SiPixelLorentzAngle::clustSizeYMin_
private

Definition at line 151 of file SiPixelLorentzAngle.h.

Referenced by analyze().

edm::ParameterSet SiPixelLorentzAngle::conf_
private

Definition at line 145 of file SiPixelLorentzAngle.h.

int SiPixelLorentzAngle::diskF_
private

Definition at line 130 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float SiPixelLorentzAngle::eta_
private

Definition at line 117 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float SiPixelLorentzAngle::etaF_
private

Definition at line 135 of file SiPixelLorentzAngle.h.

int SiPixelLorentzAngle::event_
private

Definition at line 111 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int SiPixelLorentzAngle::event_counter_
private

Definition at line 185 of file SiPixelLorentzAngle.h.

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

int SiPixelLorentzAngle::eventF_
private

Definition at line 128 of file SiPixelLorentzAngle.h.

std::string SiPixelLorentzAngle::filename_
private

Definition at line 146 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

std::string SiPixelLorentzAngle::filenameFit_
private

Definition at line 147 of file SiPixelLorentzAngle.h.

Referenced by endJob().

TH2F* SiPixelLorentzAngle::h_cluster_shape_
private

Definition at line 178 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

TH2F* SiPixelLorentzAngle::h_cluster_shape_adc_
private

Definition at line 176 of file SiPixelLorentzAngle.h.

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

TH2F* SiPixelLorentzAngle::h_cluster_shape_adc_rot_
private

Definition at line 179 of file SiPixelLorentzAngle.h.

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

TH2F* SiPixelLorentzAngle::h_cluster_shape_noadc_
private

Definition at line 177 of file SiPixelLorentzAngle.h.

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

TH2F* SiPixelLorentzAngle::h_cluster_shape_noadc_rot_
private

Definition at line 180 of file SiPixelLorentzAngle.h.

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

TH2F* SiPixelLorentzAngle::h_cluster_shape_rot_
private

Definition at line 181 of file SiPixelLorentzAngle.h.

Referenced by beginJob().

TH1F* SiPixelLorentzAngle::h_drift_depth_adc_slice_
private

Definition at line 174 of file SiPixelLorentzAngle.h.

Referenced by endJob(), and findMean().

TH1F* SiPixelLorentzAngle::h_tracks_
private

Definition at line 182 of file SiPixelLorentzAngle.h.

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

TFile* SiPixelLorentzAngle::hFile_
private

Definition at line 105 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and endJob().

int SiPixelLorentzAngle::hist_depth_
private

Definition at line 154 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and endJob().

int SiPixelLorentzAngle::hist_drift_
private

Definition at line 155 of file SiPixelLorentzAngle.h.

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

int SiPixelLorentzAngle::hist_x_
private

Definition at line 158 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

int SiPixelLorentzAngle::hist_y_
private

Definition at line 159 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

int SiPixelLorentzAngle::hitCounter_
private

Definition at line 185 of file SiPixelLorentzAngle.h.

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

int SiPixelLorentzAngle::isflipped_
private

Definition at line 115 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int SiPixelLorentzAngle::ladder_
private

Definition at line 113 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int SiPixelLorentzAngle::layer_
private

Definition at line 114 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

std::map<unsigned int,float> SiPixelLorentzAngle::m_LA
private
const MagneticField* SiPixelLorentzAngle::magfield
private

Definition at line 196 of file SiPixelLorentzAngle.h.

double SiPixelLorentzAngle::max_depth_
private

Definition at line 166 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double SiPixelLorentzAngle::max_drift_
private

Definition at line 168 of file SiPixelLorentzAngle.h.

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

double SiPixelLorentzAngle::max_x_
private

Definition at line 161 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double SiPixelLorentzAngle::max_y_
private

Definition at line 163 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double SiPixelLorentzAngle::min_depth_
private

Definition at line 165 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double SiPixelLorentzAngle::min_drift_
private

Definition at line 167 of file SiPixelLorentzAngle.h.

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

double SiPixelLorentzAngle::min_x_
private

Definition at line 160 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

double SiPixelLorentzAngle::min_y_
private

Definition at line 162 of file SiPixelLorentzAngle.h.

Referenced by beginJob(), and SiPixelLorentzAngle().

int SiPixelLorentzAngle::module_
private

Definition at line 112 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int SiPixelLorentzAngle::moduleF_
private

Definition at line 133 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double SiPixelLorentzAngle::ndof_
private

Definition at line 120 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double SiPixelLorentzAngle::ndofF_
private

Definition at line 138 of file SiPixelLorentzAngle.h.

double SiPixelLorentzAngle::normChi2Max_
private

Definition at line 150 of file SiPixelLorentzAngle.h.

Referenced by analyze().

int SiPixelLorentzAngle::panelF_
private

Definition at line 132 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float SiPixelLorentzAngle::phi_
private

Definition at line 118 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float SiPixelLorentzAngle::phiF_
private

Definition at line 136 of file SiPixelLorentzAngle.h.

int SiPixelLorentzAngle::pixelTracksCounter_
private

Definition at line 185 of file SiPixelLorentzAngle.h.

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

Pixinfo SiPixelLorentzAngle::pixinfo_
private

Definition at line 121 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Pixinfo SiPixelLorentzAngle::pixinfoF_
private

Definition at line 139 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float SiPixelLorentzAngle::pt_
private

Definition at line 116 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

float SiPixelLorentzAngle::ptF_
private

Definition at line 134 of file SiPixelLorentzAngle.h.

double SiPixelLorentzAngle::ptmin_
private

Definition at line 148 of file SiPixelLorentzAngle.h.

Referenced by analyze().

Rechit SiPixelLorentzAngle::rechit_
private

Definition at line 124 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Rechit SiPixelLorentzAngle::rechitF_
private

Definition at line 142 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

double SiPixelLorentzAngle::residualMax_
private

Definition at line 152 of file SiPixelLorentzAngle.h.

Referenced by analyze().

const TransientTrackingRecHitBuilder* SiPixelLorentzAngle::RHBuilder
private

Definition at line 192 of file SiPixelLorentzAngle.h.

int SiPixelLorentzAngle::run_
private

Definition at line 110 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

int SiPixelLorentzAngle::runF_
private

Definition at line 127 of file SiPixelLorentzAngle.h.

int SiPixelLorentzAngle::sideF_
private

Definition at line 129 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

bool SiPixelLorentzAngle::simData_
private

Definition at line 149 of file SiPixelLorentzAngle.h.

Referenced by analyze().

Hit SiPixelLorentzAngle::simhit_
private

Definition at line 122 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Hit SiPixelLorentzAngle::simhitF_
private

Definition at line 140 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

TTree* SiPixelLorentzAngle::SiPixelLorentzAngleTree_
private

Definition at line 106 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

TTree* SiPixelLorentzAngle::SiPixelLorentzAngleTreeForward_
private

Definition at line 107 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

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

Definition at line 198 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().

Chi2MeasurementEstimator* SiPixelLorentzAngle::theEstimator
private

Definition at line 191 of file SiPixelLorentzAngle.h.

const KFTrajectoryFitter* SiPixelLorentzAngle::theFitter
private

Definition at line 194 of file SiPixelLorentzAngle.h.

PropagatorWithMaterial* SiPixelLorentzAngle::thePropagator
private

Definition at line 188 of file SiPixelLorentzAngle.h.

PropagatorWithMaterial* SiPixelLorentzAngle::thePropagatorOp
private

Definition at line 189 of file SiPixelLorentzAngle.h.

const KFTrajectorySmoother* SiPixelLorentzAngle::theSmoother
private

Definition at line 193 of file SiPixelLorentzAngle.h.

KFUpdator* SiPixelLorentzAngle::theUpdator
private

Definition at line 190 of file SiPixelLorentzAngle.h.

const TrackerGeometry* SiPixelLorentzAngle::tracker
private

Definition at line 195 of file SiPixelLorentzAngle.h.

Referenced by analyze().

int SiPixelLorentzAngle::trackEventsCounter_
private

Definition at line 185 of file SiPixelLorentzAngle.h.

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

Hit SiPixelLorentzAngle::trackhit_
private

Definition at line 122 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

Hit SiPixelLorentzAngle::trackhitF_
private

Definition at line 140 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and beginJob().

TrajectoryStateTransform SiPixelLorentzAngle::tsTransform
private

Definition at line 197 of file SiPixelLorentzAngle.h.

int SiPixelLorentzAngle::usedHitCounter_
private

Definition at line 185 of file SiPixelLorentzAngle.h.

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

double SiPixelLorentzAngle::width_
private

Definition at line 164 of file SiPixelLorentzAngle.h.

Referenced by analyze(), and SiPixelLorentzAngle().