CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

edm::InputAnalyzer Class Reference

#include <InputAnalyzer.h>

Inheritance diagram for edm::InputAnalyzer:
edm::EDAnalyzer

List of all members.

Public Member Functions

 InputAnalyzer (const edm::ParameterSet &)
 ~InputAnalyzer ()

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void endJob ()

Private Attributes

bool dataStep2_
edm::InputTag label_

Detailed Description

Definition at line 33 of file InputAnalyzer.h.


Constructor & Destructor Documentation

data refman pasoursint CMSSW_5_3_0 src SimGeneral MixingModule plugins InputAnalyzer cc InputAnalyzer::InputAnalyzer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 51 of file InputAnalyzer.cc.

References dataStep2_, edm::ParameterSet::getParameter(), and label_.

{

 dataStep2_ = iConfig.getParameter<bool>("dataStep2");
 
 if (dataStep2_)
   // The data file contain the PCrossingFrame<SimTrack> 
   label_   = iConfig.getParameter<edm::InputTag>("collPCF");
 else 
   // The data file contain the SimTrack
   label_   = iConfig.getParameter<edm::InputTag>("collSimTrack");
}

InputAnalyzer::~InputAnalyzer ( )

Definition at line 65 of file InputAnalyzer.cc.

{
}


Member Function Documentation

void InputAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDAnalyzer.

Definition at line 76 of file InputAnalyzer.cc.

References gather_cfg::cout, dataStep2_, edm::Event::getByLabel(), i, and label_.

{
  std::cout << " dataStep2_ = " << dataStep2_ << std::endl;
  
  if (!dataStep2_){
  // Get the SimTrack collection
  
    //double simPt=0;
   int i=0;
   
   // Get the SimTrack collection from the event
   edm::Handle<SimTrackContainer> simTracks;
   bool gotTracks = iEvent.getByLabel(label_,simTracks);
   
   if (!gotTracks)
   {  
      std::cout<<"-> Could not read SimTracks !!!!"<<std::endl;
   }
   else{
      std::cout<<"-> Could read SimTracks !!!!"<<std::endl;
      
   }

  
   // Loop over the tracks
   SimTrackContainer::const_iterator simTrack;
   for (simTrack = simTracks->begin(); simTrack != simTracks->end(); ++simTrack){
    i++;
    
    //simPt=(*simTrack).momentum().Pt();
    //std::cout << " # i = " << i << " simPt = " << simPt << std::endl;
   
   }
   
   
 }
 else{
 // Get the PCrossingFrame collection given as signal
   
    edm::Handle<PCrossingFrame<SimTrack> > cf_simtrack;
    bool gotTracks = iEvent.getByLabel("CFWriter","g4SimHits",cf_simtrack);
    
    if (!gotTracks)
    {  
      std::cout<<"-> Could not read PCrossingFrame<SimTracks> !!!!"<<std::endl;
    }
    else
      std::cout<<"-> Could read PCrossingFrame<SimTracks> !!!!"<<std::endl;
      
   }
}

void InputAnalyzer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file InputAnalyzer.cc.

{
}

void InputAnalyzer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file InputAnalyzer.cc.


Member Data Documentation

Definition at line 46 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().

Definition at line 47 of file InputAnalyzer.h.

Referenced by analyze(), and InputAnalyzer().