Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74457
b: "refs/heads/CMSSW_7_1_X"
c: c48430c
h: "refs/heads/CMSSW_7_1_X"
i:
  74455: 2fa1a0a
v: v3
  • Loading branch information
Burt Betchart committed Sep 30, 2009
1 parent 30d5e3f commit 1321cd9
Show file tree
Hide file tree
Showing 35 changed files with 1,606 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": 96fa02802b722c0ee6cf5b1236b4b005289bb1ea
"refs/heads/CMSSW_7_1_X": c48430cf10ee1dbe19616d42776a128e00c42705
16 changes: 4 additions & 12 deletions trunk/CalibTracker/SiStripCommon/BuildFile
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
<use name=FWCore/Framework>
<use name=FWCore/MessageLogger>
<use name=FWCore/PluginManager>
<use name=FWCore/ParameterSet>
<use name=DataFormats/SiStripDetId>
<use name=boost>
<use name=DataFormats/TrackerRecHit2D>
<use name=CondFormats/SiStripObjects>
<export>
<lib name=CalibTrackerSiStripCommon>
<use name=FWCore/Framework>
<use name=FWCore/MessageLogger>
<use name=FWCore/PluginManager>
<use name=FWCore/ParameterSet>
<use name=DataFormats/SiStripDetId>
<use name=boost>
<use name=DataFormats/TrackerRecHit2D>
<use name=CondFormats/SiStripObjects>
</export>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#ifndef SHALLOW_CLUSTERS_PRODUCER
#define SHALLOW_CLUSTERS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DataFormats/Common/interface/DetSetVector.h"
class SiStripClusterInfo;
class SiStripProcessedRawDigi;

class ShallowClustersProducer : public edm::EDProducer {

public:

explicit ShallowClustersProducer(const edm::ParameterSet&);

private:

edm::InputTag theClustersLabel;
std::string Prefix;
void produce( edm::Event &, const edm::EventSetup & );

struct moduleVars {
moduleVars(uint32_t);
int subdetid, side, layerwheel, stringringrod, petal, stereo;
uint32_t module;
};

struct NearDigis {
NearDigis(const SiStripClusterInfo&);
NearDigis(const SiStripClusterInfo&, const edm::DetSetVector<SiStripProcessedRawDigi>&);
float max, left, right, first, last, Lleft, Rright;
float etaX() const {return (left+right)/max/2.;}
float eta() const {return right>left ? max/(max+right) : left/(left+max);}
float etaasymm() const {return right>left ? (right-max)/(right+max) : (max-left)/(max+left);}
float outsideasymm() const {return (last-first)/(last+first);}
};

};

#endif
39 changes: 39 additions & 0 deletions trunk/CalibTracker/SiStripCommon/interface/ShallowDigisProducer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#ifndef SHALLOW_DIGIS_PRODUCER
#define SHALLOW_DIGIS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/ESHandle.h"
class SiStripNoises;

class ShallowDigisProducer : public edm::EDProducer {

public:

explicit ShallowDigisProducer(const edm::ParameterSet&);

private:
struct products {
std::auto_ptr<std::vector<unsigned> > id;
std::auto_ptr<std::vector<unsigned> > subdet;
std::auto_ptr<std::vector<unsigned> > strip;
std::auto_ptr<std::vector<unsigned> > adc;
std::auto_ptr<std::vector<float> > noise;
products()
: id(new std::vector<unsigned>()),
subdet(new std::vector<unsigned>()),
strip(new std::vector<unsigned>()),
adc(new std::vector<unsigned>()),
noise(new std::vector<float>()) {}
};
std::vector<edm::InputTag> inputTags;
edm::ESHandle<SiStripNoises> noiseHandle;

void produce(edm::Event&, const edm::EventSetup&);
template<class T> bool findInput(edm::Handle<T>&, const edm::Event&);
template<class T> void recordDigis(const T &, products&);
void insert(products&, edm::Event&);

};

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef SHALLOW_EVENTDATA_PRODUCER
#define SHALLOW_EVENTDATA_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

class ShallowEventDataProducer : public edm::EDProducer {
public:
explicit ShallowEventDataProducer(const edm::ParameterSet&);
private:
void produce( edm::Event &, const edm::EventSetup & );
};

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef SHALLOW_EXAMPLE_PRODUCER
#define SHALLOW_EXAMPLE_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

class ShallowExampleProducer : public edm::EDProducer {
public:
explicit ShallowExampleProducer(const edm::ParameterSet&);
private:
void produce( edm::Event &, const edm::EventSetup & );
};

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef SHALLOW_RECHITCLUSTERS_PRODUCER
#define SHALLOW_RECHITCLUSTERS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

class ShallowRechitClustersProducer : public edm::EDProducer {
public:
explicit ShallowRechitClustersProducer(const edm::ParameterSet&);
private:
std::string Suffix;
std::string Prefix;
edm::InputTag theClustersLabel;
std::vector<edm::InputTag> inputTags;
void produce( edm::Event &, const edm::EventSetup & );
};

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef SHALLOW_SIMTRACKS_PRODUCER
#define SHALLOW_SIMTRACKS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

class ShallowSimTracksProducer : public edm::EDProducer {

public:

explicit ShallowSimTracksProducer(const edm::ParameterSet&);

private:

const std::string Prefix;
const std::string Suffix;
const edm::InputTag trackingParticles_tag;
const edm::ESInputTag associator_tag;
const edm::InputTag tracks_tag;
void produce( edm::Event &, const edm::EventSetup & );

};
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef SHALLOW_SIMHITCLUSTERS_PRODUCER
#define SHALLOW_SIMHITCLUSTERS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "CalibTracker/SiStripCommon/interface/ShallowTools.h"
class SiStripCluster;

class ShallowSimhitClustersProducer : public edm::EDProducer {
public:
explicit ShallowSimhitClustersProducer(const edm::ParameterSet&);
private:
std::vector<edm::InputTag> inputTags;
edm::InputTag theClustersLabel;
std::string Prefix;

void produce( edm::Event &, const edm::EventSetup & );
shallow::CLUSTERMAP::const_iterator match_cluster(const unsigned&,
const float&,
const shallow::CLUSTERMAP&,
const edmNew::DetSetVector<SiStripCluster>& ) const;
};
#endif
24 changes: 24 additions & 0 deletions trunk/CalibTracker/SiStripCommon/interface/ShallowTools.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef USERCODE_SHALLOWTOOLS_SHALLOWTOOLS
#define USERCODE_SHALLOWTOOLS_SHALLOWTOOLS

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DataFormats/Common/interface/DetSetVectorNew.h"
#include "DataFormats/TrackReco/interface/Track.h"

class StripGeomDetUnit;
class MagneticField;
class SiStripLorentzAngle;
class Event;
namespace edm {class InputTag;}

namespace shallow {

typedef std::map<std::pair<uint32_t, uint16_t>, unsigned int> CLUSTERMAP;

CLUSTERMAP make_cluster_map( const edm::Event& , edm::InputTag&);
LocalVector drift( const StripGeomDetUnit*, const MagneticField&, const SiStripLorentzAngle&);
int findTrackIndex(const edm::Handle<edm::View<reco::Track> >& h, const reco::Track* t);

}

#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef SHALLOW_TRACKCLUSTERS_PRODUCER
#define SHALLOW_TRACKCLUSTERS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

class ShallowTrackClustersProducer : public edm::EDProducer {
public:
explicit ShallowTrackClustersProducer(const edm::ParameterSet&);
private:
edm::InputTag theTracksLabel;
edm::InputTag theClustersLabel;
std::string Suffix;
std::string Prefix;

void produce( edm::Event &, const edm::EventSetup & );
};
#endif
16 changes: 16 additions & 0 deletions trunk/CalibTracker/SiStripCommon/interface/ShallowTracksProducer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef SHALLOW_TRACKS_PRODUCER
#define SHALLOW_TRACKS_PRODUCER

#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"

class ShallowTracksProducer : public edm::EDProducer {
public:
explicit ShallowTracksProducer(const edm::ParameterSet&);
private:
edm::InputTag theTracksLabel;
std::string Prefix;
std::string Suffix;
void produce( edm::Event &, const edm::EventSetup & );
};
#endif
73 changes: 73 additions & 0 deletions trunk/CalibTracker/SiStripCommon/interface/ShallowTree.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#ifndef Shallow_Tree_h
#define Shallow_Tree_h

/** \class ShallowTree
*
* Makes a tree out of C++ standard types and vectors of C++ standard types
*
* This class, which is an EDAnalyzer, takes the same "keep" and
* "drop" outputCommands parameter as the PoolOutputSource, making a
* tree of the selected variables, which it obtains from the EDM
* tree.
*
* See the file python/test_cfg.py for an example configuration.
*
* See the file doc/README for more detailed documentation, including
* advantages, disadvantages, and use philosophy.
*
* $Date: 2008/08/23 16:46:29 $
* $Revision: 1.1 $
* \author Burt Betchart - University of Rochester <[email protected]>
*/

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "PhysicsTools/UtilAlgos/interface/TFileService.h"

#include <string>
#include <vector>
#include <TTree.h>

class ShallowTree : public edm::EDAnalyzer {
private:
virtual void beginJob(const edm::EventSetup&);
virtual void analyze(const edm::Event&, const edm::EventSetup&);
virtual void endJob(){}

class BranchConnector {
public:
virtual ~BranchConnector() {};
virtual void connect(const edm::Event&) = 0;
};

template <class T>
class TypedBranchConnector : public BranchConnector {
private:
std::string ml; //module label
std::string pin; //product instance name
T object_;
T* object_ptr_;
public:
TypedBranchConnector(edm::BranchDescription const*, std::string, TTree*);
void connect(const edm::Event&);
};

edm::Service<TFileService> fs;
TTree * tree;
std::vector<BranchConnector*> connectors;
edm::ParameterSet pset;

public:
explicit ShallowTree(const edm::ParameterSet& iConfig) : pset(iConfig) {}

enum LEAFTYPE {BOOL=1, BOOL_V,
SHORT, SHORT_V, U_SHORT, U_SHORT_V,
INT, INT_V, U_INT, U_INT_V,
FLOAT, FLOAT_V, DOUBLE, DOUBLE_V,
LONG, LONG_V, U_LONG, U_LONG_V };
};

#endif
9 changes: 4 additions & 5 deletions trunk/CalibTracker/SiStripCommon/plugins/BuildFile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<use name=FWCore/Framework>
<use name=FWCore/PluginManager>
<use name=FWCore/ParameterSet>
<use name=Geometry/Records>
<use name=Geometry/TrackerGeometryBuilder>
<use name=AnalysisDataFormats/SiStripClusterInfo>
<use name=PhysicsTools/UtilAlgos>
<use name=SimTracker/TrackAssociation>
<use name=TrackingTools/TrackFitters>
<use name=CalibTracker/SiStripCommon>
<library file="*.cc" name=CalibTrackerSiStripCommonPlugins>
<flags EDM_PLUGIN=1>
Expand Down
21 changes: 20 additions & 1 deletion trunk/CalibTracker/SiStripCommon/plugins/SealModules.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "FWCore/PluginManager/interface/ModuleDef.h"

#include "FWCore/Framework/interface/MakerMacros.h"
//#include "FWCore/Framework/interface/ModuleFactory.h"
//#include "FWCore/Framework/interface/eventsetupdata_registration_macro.h"
Expand All @@ -16,3 +15,23 @@ DEFINE_ANOTHER_FWK_SERVICE(SiStripDetInfoFileReader);
#include "CalibTracker/SiStripCommon/interface/TkDetMap.h"
DEFINE_ANOTHER_FWK_SERVICE(TkDetMap);


#include "CalibTracker/SiStripCommon/interface/ShallowTree.h"
#include "CalibTracker/SiStripCommon/interface/ShallowEventDataProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowDigisProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowClustersProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowTrackClustersProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowRechitClustersProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowSimhitClustersProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowTracksProducer.h"
#include "CalibTracker/SiStripCommon/interface/ShallowSimTracksProducer.h"

DEFINE_ANOTHER_FWK_MODULE(ShallowTree);
DEFINE_ANOTHER_FWK_MODULE(ShallowEventDataProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowDigisProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowClustersProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowTrackClustersProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowRechitClustersProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowSimhitClustersProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowTracksProducer);
DEFINE_ANOTHER_FWK_MODULE(ShallowSimTracksProducer);
Loading

0 comments on commit 1321cd9

Please sign in to comment.