CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

SiPixelFakeLorentzAngleESSource Class Reference

#include <CalibTracker/SiPixelESProducer/src/SiPixelFakeLorentzAngleESSource.cc>

Inheritance diagram for SiPixelFakeLorentzAngleESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

virtual std::auto_ptr
< SiPixelLorentzAngle
produce (const SiPixelLorentzAngleRcd &)
 SiPixelFakeLorentzAngleESSource (const edm::ParameterSet &)
 ~SiPixelFakeLorentzAngleESSource ()

Protected Member Functions

virtual void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Attributes

edm::FileInPath fp_

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 37 of file SiPixelFakeLorentzAngleESSource.h.


Constructor & Destructor Documentation

SiPixelFakeLorentzAngleESSource::SiPixelFakeLorentzAngleESSource ( const edm::ParameterSet conf_)

Definition at line 29 of file SiPixelFakeLorentzAngleESSource.cc.

References edm::ESProducer::setWhatProduced().

                                                                                             : fp_(conf_.getParameter<edm::FileInPath>("file"))
{
        edm::LogInfo("SiPixelFakeLorentzAngleESSource::SiPixelFakeLorentzAngleESSource");
        //the following line is needed to tell the framework what
        // data is being produced
        setWhatProduced(this);
        findingRecord<SiPixelLorentzAngleRcd>();
}
SiPixelFakeLorentzAngleESSource::~SiPixelFakeLorentzAngleESSource ( )

Definition at line 38 of file SiPixelFakeLorentzAngleESSource.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

std::auto_ptr< SiPixelLorentzAngle > SiPixelFakeLorentzAngleESSource::produce ( const SiPixelLorentzAngleRcd ) [virtual]

Definition at line 46 of file SiPixelFakeLorentzAngleESSource.cc.

References fp_, edm::FileInPath::fullPath(), getGTfromDQMFile::obj, and matplotRender::reader.

{

        using namespace edm::es;
        unsigned int nmodules = 0;
        SiPixelLorentzAngle * obj = new SiPixelLorentzAngle();
        SiPixelDetInfoFileReader reader(fp_.fullPath());
        const std::vector<uint32_t> DetIds = reader.getAllDetIds();
        
        // Loop over detectors
        for(std::vector<uint32_t>::const_iterator detit = DetIds.begin(); detit!=DetIds.end(); detit++) {
                nmodules++;
                float langle =  0.106;   
                //std::cout << "detid " << (*detit) << std::endl;
        
                if( !obj->putLorentzAngle(*detit,langle) ) edm::LogError("SiPixelFakeLorentzAngleESSource")<<"[SiPixelFakeLorentzAngleESSource::produce] detid already exists"<<std::endl;
        }
        
        //std::cout << "Modules = " << nmodules << std::endl;

        return std::auto_ptr<SiPixelLorentzAngle>(obj);
        

}
void SiPixelFakeLorentzAngleESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
) [protected, virtual]

Member Data Documentation

Definition at line 56 of file SiPixelFakeLorentzAngleESSource.h.

Referenced by produce().