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"))
84 SiPixelLorentzAngleTree_->Branch(
"clust", &
clust_,
"x/F:y/F:charge/F:size_x/I:size_y/I:maxPixelCol/I:maxPixelRow:minPixelCol/I:minPixelRow/I", bufsize);
114 for(
int i_module = 1; i_module<=8; i_module++){
115 for(
int i_layer = 1; i_layer<=3; i_layer++){
116 sprintf(name,
"h_drift_depth_adc_layer%i_module%i", i_layer, i_module);
118 sprintf(name,
"h_drift_depth_adc2_layer%i_module%i", i_layer, i_module);
120 sprintf(name,
"h_drift_depth_noadc_layer%i_module%i", i_layer, i_module);
122 sprintf(name,
"h_drift_depth_layer%i_module%i", i_layer, i_module);
124 sprintf(name,
"h_mean_layer%i_module%i", i_layer, i_module);
136 h_tracks_ =
new TH1F(
"h_tracks",
"h_tracks",2,0.,2.);
178 if(trajTrackCollectionHandle->size() >0){
181 const Track& track = *it->val;
185 std::vector<TrajectoryMeasurement> tmColl = traj.
measurements();
194 std::vector<PSimHit> matched;
196 bool pixeltrack =
false;
197 for(std::vector<TrajectoryMeasurement>::const_iterator itTraj = tmColl.begin(); itTraj != tmColl.end(); itTraj++) {
198 if(! itTraj->updatedState().isValid())
continue;
200 if(! recHit->isValid() || recHit->geographicalId().det() !=
DetId::Tracker )
continue;
201 unsigned int subDetID = (recHit->geographicalId().subdetId());
213 DetId detIdObj = recHit->geographicalId();
215 if(!theGeomDet)
continue;
229 if(!recHitPix)
continue;
249 cout <<
"tsos not valid" << endl;
255 if(trackdirection.
z()==0)
continue;
268 float dr_start=9999.;
269 for (std::vector<PSimHit>::iterator isim = matched.begin(); isim != matched.end(); ++isim){
270 DetId simdetIdObj((*isim).detUnitId());
271 if (simdetIdObj == detIdObj) {
272 float sim_x1 = (*isim).entryPoint().x();
273 float sim_y1 = (*isim).entryPoint().y();
274 float sim_x2 = (*isim).exitPoint().x();
275 float sim_y2 = (*isim).exitPoint().y();
276 float sim_xpos = 0.5*(sim_x1+sim_x2);
277 float sim_ypos = 0.5*(sim_y1+sim_y2);
278 float sim_px = (*isim).momentumAtEntry().x();
279 float sim_py = (*isim).momentumAtEntry().y();
280 float sim_pz = (*isim).momentumAtEntry().z();
296 bool large_pix =
false;
330 DetId detIdObj = recHit->geographicalId();
332 if(!theGeomDet)
continue;
348 if(!recHitPix)
continue;
368 cout <<
"tsos not valid" << endl;
374 if(trackdirection.
z()==0)
continue;
387 float dr_start=9999.;
388 for (std::vector<PSimHit>::iterator isim = matched.begin(); isim != matched.end(); ++isim){
389 DetId simdetIdObj((*isim).detUnitId());
390 if (simdetIdObj == detIdObj) {
391 float sim_x1 = (*isim).entryPoint().x();
392 float sim_y1 = (*isim).entryPoint().y();
393 float sim_x2 = (*isim).exitPoint().x();
394 float sim_y2 = (*isim).exitPoint().y();
395 float sim_xpos = 0.5*(sim_x1+sim_x2);
396 float sim_ypos = 0.5*(sim_y1+sim_y2);
397 float sim_px = (*isim).momentumAtEntry().x();
398 float sim_py = (*isim).momentumAtEntry().y();
399 float sim_pz = (*isim).momentumAtEntry().z();
429 for(
int i_ring = 1; i_ring<=24; i_ring++){
435 TF1 *
f1 =
new TF1(
"f1",
"[0] + [1]*x",50., 235.);
436 f1->SetParName(0,
"p0");
437 f1->SetParName(1,
"p1");
438 f1->SetParameter(0,0);
439 f1->SetParameter(1,0.4);
442 fLorentzFit <<
"module" <<
"\t" <<
"layer" <<
"\t" <<
"offset" <<
"\t" <<
"error" <<
"\t" <<
"slope" <<
"\t" <<
"error" <<
"\t" "rel.err" <<
"\t" "pull" <<
"\t" <<
"chi2" <<
"\t" <<
"prob" << endl;
444 for(
int i_layer = 1; i_layer<=3; i_layer++){
445 for(
int i_module = 1; i_module<=8; i_module++){
448 findMean(
i, (i_module + (i_layer - 1) * 8));
450 _h_mean_[i_module + (i_layer - 1) * 8]->
Fit(f1,
"ERQ");
451 double p0 = f1->GetParameter(0);
452 double e0 = f1->GetParError(0);
453 double p1 = f1->GetParameter(1);
454 double e1 = f1->GetParError(1);
455 double chi2 = f1->GetChisquare();
456 double prob = f1->GetProb();
457 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;
462 for(
int i_module = 1; i_module<=8; i_module++){
463 for(
int i_layer = 1; i_layer<=3; i_layer++){
468 _h_mean_[i_module + (i_layer -1) * 8]->Write();
489 const std::vector<SiPixelCluster::Pixel>& pixvector = LocPix.
pixels();
491 for(std::vector<SiPixelCluster::Pixel>::const_iterator itPix = pixvector.begin(); itPix != pixvector.end(); itPix++){
493 pixinfo.
row[pixinfo.
npix] = itPix->x;
494 pixinfo.
col[pixinfo.
npix] = itPix->y;
495 pixinfo.
adc[pixinfo.
npix] = itPix->adc;
497 pixinfo.
x[pixinfo.
npix] = lp.
x();
498 pixinfo.
y[pixinfo.
npix]= lp.
y();
533 _h_mean_[i_ring]->SetBinContent(i, mean);
534 _h_mean_[i_ring]->SetBinError(i, error);
TH2F * h_cluster_shape_noadc_
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
T getParameter(std::string const &) const
EventNumber_t event() const
unsigned int panel() const
panel id
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
TH2F * h_cluster_shape_rot_
TTree * SiPixelLorentzAngleTreeForward_
LocalVector localDirection() const
LocalPoint localPosition() 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 &)
double phi() const
azimuthal angle of momentum vector
unsigned int ladder() const
ladder id
unsigned int layer() const
layer id
std::map< int, TH2F * > _h_drift_depth_noadc_
unsigned int blade() const
blade id
std::map< int, TH2F * > _h_drift_depth_
const TrackerGeometry * tracker
DataContainer const & measurements() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
double eta() const
pseudorapidity of momentum vector
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double pt() const
track transverse momentum
Tan< T >::type tan(const T &t)
unsigned int module() const
det id
unsigned int module() const
det id
TH2F * h_cluster_shape_adc_
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int disk() const
disk id
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
Point3DBase< float, LocalTag > Local3DPoint
int ndof(bool bon=true) const
virtual LocalPoint localPosition() const
ClusterRef cluster() const
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
TH1F * h_drift_depth_adc_slice_
Pixel cluster – collection of neighboring pixels above threshold.
TTree * SiPixelLorentzAngleTree_
const BoundPlane & surface() const
The nominal surface of the GeomDet.
TH2F * h_cluster_shape_noadc_rot_
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
unsigned int side() const
positive or negative id
std::map< int, TH2F * > _h_drift_depth_adc2_
TH2F * h_cluster_shape_adc_rot_
void findMean(int i, int i_ring)
std::map< int, TH1F * > _h_mean_
const std::vector< Pixel > pixels() const
double chiSquared() const
virtual ~SiPixelLorentzAngle()