149 double sCenergy = seedCluster->energy();
151 double scEta = seedCluster->eta();
153 double scz = sCposition.z();
154 double scr =
sqrt(
pow(sCposition.x(),2)+
pow(sCposition.y(),2));
156 double pT = sCenergy * seedCluster->position().rho()/
sqrt(seedCluster->x()*seedCluster->x()+seedCluster->y()*seedCluster->y()+seedCluster->z()*seedCluster->z());
159 double magneticField = 3.8;
162 double phiVsRSlope = -3.00e-3 * magneticField / pT / 2.;
167 GlobalPoint superCluster(sCposition.x(),sCposition.y(),sCposition.z());
176 int chargeHypothesis;
177 double chargeSelector = sCenergy - (int)sCenergy;
178 if(chargeSelector >= 0.5) chargeHypothesis = -1;
179 if(chargeSelector < 0.5) chargeHypothesis = 1;
183 double phiFake =
phiDiff(superCluster.phi(),chargeHypothesis * phiVsRSlope * (scr - rFake));
184 double zFake = (rFake*(scz-z0)-r0*scz+scr*z0)/(scr-r0);
185 double xFake = rFake *
cos(phiFake);
186 double yFake = rFake *
sin(phiFake);
192 float nomField = bfield->nominalValue();
207 std::vector<BarrelDetLayer*> tibLayers = gst->tibLayers();
211 std::vector<ForwardDetLayer*> tecLayers;
212 std::vector<ForwardDetLayer*> tidLayers;
214 tecLayers = gst->negTecLayers();
215 tidLayers = gst->negTidLayers();
218 tecLayers = gst->posTecLayers();
219 tidLayers = gst->posTidLayers();
248 bool hasLay1Hit =
false;
249 bool hasLay2Hit =
false;
250 bool hasBackupHit =
false;
254 std::vector<TrajectoryMeasurement> tib1measurements;
256 std::vector<TrajectoryMeasurement> tib2measurements;
263 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tib1measurements.begin(); tmIter != tib1measurements.end(); ++ tmIter){
268 if(
preselection(position, superCluster, phiVsRSlope, 1)){
275 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tib2measurements.begin(); tmIter != tib2measurements.end(); ++ tmIter){
280 if(
preselection(position, superCluster, phiVsRSlope, 1)){
287 if(!(hasLay1Hit && hasLay2Hit)) useTID =
true;
289 std::vector<TrajectoryMeasurement> tid1measurements;
290 if(useDL.at(2) && useTID) tid1measurements = layerMeasurements.measurements(*tid1,initialTSOS,*
thePropagator,*
theEstimator);
291 std::vector<TrajectoryMeasurement> tid2measurements;
292 if(useDL.at(3) && useTID) tid2measurements = layerMeasurements.measurements(*tid2,initialTSOS,*
thePropagator,*
theEstimator);
293 std::vector<TrajectoryMeasurement> tid3measurements;
294 if(useDL.at(4) && useTID) tid3measurements = layerMeasurements.measurements(*tid3,initialTSOS,*
thePropagator,*
theEstimator);
296 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid1measurements.begin(); tmIter != tid1measurements.end(); ++ tmIter){
302 if(
preselection(position, superCluster, phiVsRSlope, 2)){
313 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
323 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid2measurements.begin(); tmIter != tid2measurements.end(); ++ tmIter){
329 if(
preselection(position, superCluster, phiVsRSlope, 2)){
340 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
350 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tid3measurements.begin(); tmIter != tid3measurements.end(); ++ tmIter){
356 if(
preselection(position, superCluster, phiVsRSlope, 2)){
367 if(
preselection(position, superCluster, phiVsRSlope, 4) && position.
perp() > 37.){
377 std::vector<TrajectoryMeasurement> tec1measurements;
379 std::vector<TrajectoryMeasurement> tec2measurements;
381 std::vector<TrajectoryMeasurement> tec3measurements;
384 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec1measurements.begin(); tmIter != tec1measurements.end(); ++ tmIter){
390 if(
preselection(position, superCluster, phiVsRSlope, 3)){
401 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec2measurements.begin(); tmIter != tec2measurements.end(); ++ tmIter){
407 if(
preselection(position, superCluster, phiVsRSlope, 3)){
418 for(std::vector<TrajectoryMeasurement>::const_iterator tmIter = tec3measurements.begin(); tmIter != tec3measurements.end(); ++ tmIter){
424 if(
preselection(position, superCluster, phiVsRSlope, 3)){
434 if( hasLay1Hit && hasLay2Hit ){
436 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1 =
layer1Hits_.begin() ; hit1!=
layer1Hits_.end(); ++hit1) {
437 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit2 =
layer2Hits_.begin() ; hit2!=
layer2Hits_.end(); ++hit2) {
447 SiStripMatchedRecHit2D *hit;
448 hit=
new SiStripMatchedRecHit2D(*(dynamic_cast <const SiStripMatchedRecHit2D *> (*hit1) ) );
450 hit=
new SiStripMatchedRecHit2D(*(dynamic_cast <const SiStripMatchedRecHit2D *> (*hit2) ) );
456 seed.setCaloCluster(caloCluster) ;
471 if(hasLay1Hit && hasBackupHit && seedCounter == 0){
473 for (std::vector<const SiStripMatchedRecHit2D*>::const_iterator hit1 =
layer1Hits_.begin() ; hit1!=
layer1Hits_.end(); ++hit1) {
484 SiStripMatchedRecHit2D *innerHit;
485 innerHit=
new SiStripMatchedRecHit2D(*(dynamic_cast <const SiStripMatchedRecHit2D *> (*hit1) ) );
487 SiStripRecHit2D *outerHit;
488 outerHit=
new SiStripRecHit2D(*(dynamic_cast <const SiStripRecHit2D *> (*hit2) ) );
494 seed.setCaloCluster(caloCluster) ;
bool checkHitsAndTSOS(std::vector< const SiStripMatchedRecHit2D * >::const_iterator hit1, std::vector< const SiStripMatchedRecHit2D * >::const_iterator hit2, double scr, double scz, double pT, double scEta)
std::vector< bool > useDetLayer(double scEta)
Sin< T >::type sin(const T &t)
const MeasurementTracker * theMeasurementTracker
Chi2MeasurementEstimator * theEstimator
const SiStripMatchedRecHit2D * matchedHitConverter(ConstRecHitPointer crhp)
static int position[TOTALCHAMBERS][3]
PRecHitContainer recHits_
Cos< T >::type cos(const T &t)
const edm::EventSetup * theSetup
edm::ESHandle< TrackerGeometry > trackerGeometryHandle
PropagatorWithMaterial * thePropagator
bool preselection(GlobalPoint position, GlobalPoint superCluster, double phiVsRSlope, int hitLayer)
const SiStripRecHit2D * backupHitConverter(ConstRecHitPointer crhp)
bool altCheckHitsAndTSOS(std::vector< const SiStripMatchedRecHit2D * >::const_iterator hit1, std::vector< const SiStripRecHit2D * >::const_iterator hit2, double scr, double scz, double pT, double scEta)
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< const SiStripMatchedRecHit2D * > layer2Hits_
double phiDiff(double phi1, double phi2)
PTrajectoryStateOnDet pts_
std::vector< const SiStripRecHit2D * > backupLayer2Hits_
std::vector< const SiStripMatchedRecHit2D * > layer1Hits_
Power< A, B >::type pow(const A &a, const B &b)