MiniAOD extension for quark-gluon tagger

The QGTagger.cc plugin is updated to work also on pat::Jets and pat::PackedCandidate.
The QGTagger class is now a templated QGTagger<jetClass>, so that instead of the original QGTagger plugin, we have a QGTaggerPFJets and a QGTaggerPatJets defined.
The updated cfi fragment shows how it can be used in different situations.
The code is also a bit cleaned up to be more readable.
Uhmm,
it turns out that it's the first dereferencing that has the most cost.
At this point it's not your problem, it's the CompositePtrCandidate
implementation problem.
I now recall Vincenzo (@VinInn ) mentioned this before.
For the case I'm checking (100 events TTBar 35PU@25ns) it takes about 9
microseconds
(~2K CPU cycles)
to dereference a CandidatePtr.


On 12/24/14 1:23 PM, Tom Cornelis wrote:
> In RecoJets/JetProducers/plugins/QGTagger.cc
> <https://github.com/cms-sw/cmssw/pull/6930#discussion-diff-22262389>:
> 
>>  
>>    //Loop over the jet constituents
>> -  for(auto part : jet->getPFConstituents()){
>> -    if(!part.isNonnull()) continue;
>> -
>> -    reco::TrackRef itrk = part->trackRef();
>> -    if(itrk.isNonnull()){												//Track exists --> charged particle
>> -      reco::VertexCollection::const_iterator vtxClose = vC->begin();							//Search for closest vertex to track
>> -      for(auto vtx = vC->begin(); vtx != vC->end(); ++vtx){
>> -        if(fabs(itrk->dz(vtx->position())) < fabs(itrk->dz(vtxClose->position()))) vtxClose = vtx;
>> +  for(auto daughter = jet->begin(); daughter < jet->end(); ++daughter){
>> +    if(isPackedCandidate(&*daughter)){											//packed candidate situation
> 
> Indeed, you're right, I switched to for(auto daughter:
> jet->getJetConstituentsQuick()) which loops over vectorreco::Candidate*
> 
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/cms-sw/cmssw/pull/6930/files#r22262389>.
> 

-- 
***********************************************************************
 Vyacheslav (Slava) Krutelyov
 TAMU: Physics Dept Texas A&M MS4242, College Station, TX 77843-4242
 CERN: 42-R-027
 AIM/Skype: siava16              googleTalk: slava77@gmail.com
 (630) 291-5128  Cell (US)       +41 76 275 7116 Cell (CERN)

-----------------------------------------------------------------------