73 input_MinQuality_ = iConfig.
getParameter<
int>(
"MinQuality");
77 if ( input_AssociationType_.label() ==
"TracksToVertex" ) {
78 produces<TrackCollection>(
"T2V");
80 if ( input_AssociationType_.label() ==
"VertexToTracks" ) {
81 produces<TrackCollection>(
"V2T");
83 if ( input_AssociationType_.label() ==
"Both" ) {
84 produces<TrackCollection>(
"T2V");
85 produces<TrackCollection>(
"V2T");
87 std::cout <<
"No correct InputTag for AssociationType!" << std::endl;
88 std::cout <<
"Won't produce any TrackCollection!" << std::endl;
114 auto_ptr<TrackCollection> t2v_firstvertextracks(
new TrackCollection() );
115 auto_ptr<TrackCollection> v2t_firstvertextracks(
new TrackCollection() );
117 bool t2vassmap =
false;
118 bool v2tassmap =
false;
124 string asstype = input_AssociationType_.label();
126 if ( ( asstype ==
"TracksToVertex" ) || ( asstype ==
"Both" ) ) {
127 if ( iEvent.
getByLabel(input_AssociationMap_, t2vAM ) ) {
132 if ( ( asstype ==
"VertexToTracks" ) || ( asstype ==
"Both" ) ) {
133 if ( iEvent.
getByLabel(input_AssociationMap_, v2tAM ) ) {
138 if ( !t2vassmap && !v2tassmap ) {
139 cout <<
"No input collection could be found" << endl;
145 iEvent.
getByLabel(input_generalTracksCollection_,input_trckcollH);
152 for (
unsigned int trckcoll_ite = 0; trckcoll_ite < trckcoll.size(); trckcoll_ite++){
154 float quality = trckcoll[trckcoll_ite].second;
156 if ( quality>=input_MinQuality_ ) {
158 TrackRef AMtrkref = trckcoll[trckcoll_ite].first;
160 for(
unsigned int index_input_trck=0; index_input_trck<input_trckcollH->size(); index_input_trck++){
164 if( TrackMatch(*AMtrkref,*input_trackref) ){
166 t2v_firstvertextracks->push_back(*AMtrkref);
177 iEvent.
put( t2v_firstvertextracks,
"T2V" );
185 iEvent.
getByLabel(input_VertexCollection_,input_vtxcollH);
187 VertexRef firstVertexRef(input_vtxcollH,0);
191 for(v2t_ite=v2tAM->begin(); v2t_ite!=v2tAM->end(); v2t_ite++){
195 for(
unsigned int index_input_trck=0; index_input_trck<input_trckcollH->size(); index_input_trck++){
199 if(TrackMatch(*AMtrkref,*input_trackref)){
201 for(
unsigned v_ite = 0; v_ite<(v2t_ite->
val).
size(); v_ite++){
204 float quality = (v2t_ite->
val)[v_ite].
second;
206 if ( (vtxref==firstVertexRef) && (quality>=input_MinQuality_) ){
207 v2t_firstvertextracks->push_back(*AMtrkref);
218 iEvent.
put( v2t_firstvertextracks,
"V2T" );
229 (track1).
eta() == (track2).
eta() &&
230 (track1).
phi() == (track2).
phi() &&
231 (track1).chi2() == (track2).chi2() &&
232 (track1).ndof() == (track2).ndof() &&
233 (track1).
p() == (track2).
p()
T getParameter(std::string const &) const
std::vector< TrackQualityPair > TrackQualityPairVector
std::vector< Track > TrackCollection
collection of Tracks
DEFINE_FWK_MODULE(HiMixingModule)
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::AssociationMap< edm::OneToManyWithQuality< reco::VertexCollection, reco::TrackCollection, int > > TrackToVertexAssMap
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T first(std::pair< T, U > const &p)
tuple size
Write out results.
edm::AssociationMap< edm::OneToManyWithQuality< reco::TrackCollection, reco::VertexCollection, int > > VertexToTrackAssMap