00001 #include "RecoTracker/TkMSParametrization/interface/PixelRecoUtilities.h" 00002 #include "DataFormats/GeometryVector/interface/GlobalPoint.h" 00003 #include "FWCore/Framework/interface/ESHandle.h" 00004 #include "FWCore/Framework/interface/EventSetup.h" 00005 #include "MagneticField/Engine/interface/MagneticField.h" 00006 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" 00007 double PixelRecoUtilities:: 00008 longitudinalBendingCorrection( double radius, double pt,const edm::EventSetup& iSetup) 00009 { 00010 double invCurv = bendingRadius(pt,iSetup); 00011 if ( invCurv == 0. ) return 0.; 00012 return radius/6. * radius*radius/(2.*invCurv * 2.*invCurv); 00013 } 00014 00015 00016 // void PixelRecoUtilities:: MaginTesla( const edm::EventSetup& iSetup){ 00017 // edm::ESHandle<MagneticField> pSetup; 00018 // iSetup.get<IdealMagneticFieldRecord>().get(pSetup); 00019 // // mgfieldininversegev=pSetup->inTesla(GlobalPoint(0,0,0))* 2.99792458e-3; 00020 // } 00021 float PixelRecoUtilities::fieldInInvGev(const edm::EventSetup& iSetup) 00022 { 00023 edm::ESHandle<MagneticField> pSetup; 00024 iSetup.get<IdealMagneticFieldRecord>().get(pSetup); 00025 //MP da capire come accedere al B 00026 static float theInvField = 00027 1./fabs(pSetup->inTesla(GlobalPoint(0,0,0)).z() *2.99792458e-3); 00028 return theInvField; 00029 } 00030 00031 00032 00033 // #include "Utilities/UI/interface/SimpleConfigurable.h" 00034 // #include <stdio.h> 00035 00036 // TimingReport::Item * PixelRecoUtilities::initTiming( 00037 // string name, int onLevel) 00038 // { 00039 // static SimpleConfigurable<int> level(0,"TkTrackingRegions:timingLevel"); 00040 // char Lev[] = "9999 "; 00041 // if (onLevel >= 0 && onLevel < 9999) sprintf(Lev,"(%d) ", onLevel); 00042 00043 // TimingReport::Item * item = &(*TimingReport::current())[string(Lev)+name]; 00044 // item->switchCPU(false); 00045 // if (onLevel > level) item->switchOn(false); 00046 // return item; 00047 // }