59 token_TrackToVertexAssMap_ = mayConsume<TrackToVertexAssMap>(iConfig.
getParameter<
InputTag>(
"AssociationMap"));
60 token_VertexToTrackAssMap_ = mayConsume<VertexToTrackAssMap>(iConfig.
getParameter<
InputTag>(
"AssociationMap"));
62 token_generalTracksCollection_ = consumes<TrackCollection>(iConfig.
getParameter<
InputTag>(
"TrackCollection"));
64 token_VertexCollection_ = mayConsume<VertexCollection>(iConfig.
getParameter<
InputTag>(
"VertexCollection"));
66 input_MinQuality_ = iConfig.
getParameter<
int>(
"MinQuality");
70 if ( input_AssociationType_.label() ==
"TracksToVertex" ) {
71 produces<TrackCollection>(
"T2V");
73 if ( input_AssociationType_.label() ==
"VertexToTracks" ) {
74 produces<TrackCollection>(
"V2T");
76 if ( input_AssociationType_.label() ==
"Both" ) {
77 produces<TrackCollection>(
"T2V");
78 produces<TrackCollection>(
"V2T");
80 std::cout <<
"No correct InputTag for AssociationType!" << std::endl;
81 std::cout <<
"Won't produce any TrackCollection!" << std::endl;
107 auto_ptr<TrackCollection> t2v_firstvertextracks(
new TrackCollection() );
108 auto_ptr<TrackCollection> v2t_firstvertextracks(
new TrackCollection() );
110 bool t2vassmap =
false;
111 bool v2tassmap =
false;
117 string asstype = input_AssociationType_.label();
119 if ( ( asstype ==
"TracksToVertex" ) || ( asstype ==
"Both" ) ) {
120 if ( iEvent.
getByToken(token_TrackToVertexAssMap_, t2vAM ) ) {
125 if ( ( asstype ==
"VertexToTracks" ) || ( asstype ==
"Both" ) ) {
126 if ( iEvent.
getByToken(token_VertexToTrackAssMap_, v2tAM ) ) {
131 if ( !t2vassmap && !v2tassmap ) {
132 cout <<
"No input collection could be found" << endl;
138 iEvent.
getByToken(token_generalTracksCollection_,input_trckcollH);
145 for (
unsigned int trckcoll_ite = 0; trckcoll_ite < trckcoll.size(); trckcoll_ite++){
147 float quality = trckcoll[trckcoll_ite].second;
149 if ( quality>=input_MinQuality_ ) {
151 TrackRef AMtrkref = trckcoll[trckcoll_ite].first;
153 for(
unsigned int index_input_trck=0; index_input_trck<input_trckcollH->size(); index_input_trck++){
157 if( TrackMatch(*AMtrkref,*input_trackref) ){
159 t2v_firstvertextracks->push_back(*AMtrkref);
170 iEvent.
put( t2v_firstvertextracks,
"T2V" );
178 iEvent.
getByToken(token_VertexCollection_,input_vtxcollH);
180 VertexRef firstVertexRef(input_vtxcollH,0);
184 for(v2t_ite=v2tAM->begin(); v2t_ite!=v2tAM->end(); v2t_ite++){
188 for(
unsigned int index_input_trck=0; index_input_trck<input_trckcollH->size(); index_input_trck++){
192 if(TrackMatch(*AMtrkref,*input_trackref)){
194 for(
unsigned v_ite = 0; v_ite<(v2t_ite->
val).
size(); v_ite++){
199 if ( (vtxref==firstVertexRef) && (quality>=input_MinQuality_) ){
200 v2t_firstvertextracks->push_back(*AMtrkref);
211 iEvent.
put( v2t_firstvertextracks,
"V2T" );
222 (track1).
eta() == (track2).
eta() &&
223 (track1).
phi() == (track2).
phi() &&
224 (track1).chi2() == (track2).chi2() &&
225 (track1).ndof() == (track2).ndof() &&
226 (track1).
p() == (track2).
p()
T getParameter(std::string const &) const
std::vector< TrackQualityPair > TrackQualityPairVector
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< Track > TrackCollection
collection of Tracks
U second(std::pair< T, U > const &p)
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T first(std::pair< T, U > const &p)
tuple size
Write out results.