@@ -45,6 +45,8 @@ namespace analysis
4545namespace identifiedbffilter
4646{
4747
48+ const std::vector<int > pdgcodes = {11 , 211 , 321 , 2212 };
49+
4850// / \enum MatchRecoGenSpecies
4951// / \brief The species considered by the matching test
5052enum MatchRecoGenSpecies {
@@ -128,6 +130,8 @@ enum CentMultEstimatorType {
128130 knCentMultEstimators // /< number of centrality/mutiplicity estimator
129131};
130132
133+ float overallminp = 0 .0f ;
134+
131135// / \enum TriggerSelectionType
132136// / \brief The type of trigger to apply for event selection
133137enum TriggerSelectionType {
@@ -716,54 +720,15 @@ void exploreMothers(ParticleObject& particle, MCCollisionObject& collision)
716720 }
717721}
718722
719- // / \brief Accepts or not the passed generated particle
720- // / \param track the particle of interest
721- // / \return the internal particle id, -1 if not accepted
722- // / TODO: the PID implementation
723- // / For the time being we keep the convention
724- // / - positive particle pid even
725- // / - negative particle pid odd
726- // / - charged hadron 0/1
727- template <typename ParticleObject, typename MCCollisionObject>
728- inline int8_t AcceptParticle (ParticleObject& particle, MCCollisionObject const & collision)
723+ template <typename ParticleObject>
724+ inline float getCharge (ParticleObject& particle)
729725{
730- float charge = (fPDG ->GetParticle (particle.pdgCode ())->Charge () / 3 >= 1 ) ? 1.0 : ((fPDG ->GetParticle (particle.pdgCode ())->Charge () / 3 <= -1 ) ? -1.0 : 0.0 );
731-
732- if (particle.isPhysicalPrimary ()) {
733- if ((particle.mcCollisionId () == 0 ) && traceCollId0) {
734- LOGF (info, " Particle %d passed isPhysicalPrimary" , particle.globalIndex ());
735- }
736- if (useOwnParticleSelection) {
737- float dcaxy = TMath::Sqrt ((particle.vx () - collision.posX ()) * (particle.vx () - collision.posX ()) +
738- (particle.vy () - collision.posY ()) * (particle.vy () - collision.posY ()));
739- float dcaz = TMath::Abs (particle.vz () - collision.posZ ());
740- if (!((dcaxy < particleMaxDCAxy) && (dcaz < particleMaxDCAZ))) {
741- if ((particle.mcCollisionId () == 0 ) && traceCollId0) {
742- LOGF (info, " Rejecting particle with dcaxy: %.2f and dcaz: %.2f" , dcaxy, dcaz);
743- LOGF (info, " assigned collision Id: %d, looping on collision Id: %d" , particle.mcCollisionId (), collision.globalIndex ());
744- LOGF (info, " Collision x: %.5f, y: %.5f, z: %.5f" , collision.posX (), collision.posY (), collision.posZ ());
745- LOGF (info, " Particle x: %.5f, y: %.5f, z: %.5f" , particle.vx (), particle.vy (), particle.vz ());
746- LOGF (info, " index: %d, pdg code: %d" , particle.globalIndex (), particle.pdgCode ());
747-
748- exploreMothers (particle, collision);
749- }
750- return -1 ;
751- }
752- }
753- if (ptlow < particle.pt () && particle.pt () < ptup && etalow < particle.eta () && particle.eta () < etaup) {
754- if (charge > 0 ) {
755- return 0 ;
756- }
757- if (charge < 0 ) {
758- return 1 ;
759- }
760- }
761- } else {
762- if ((particle.mcCollisionId () == 0 ) && traceCollId0) {
763- LOGF (info, " Particle %d NOT passed isPhysicalPrimary" , particle.globalIndex ());
764- }
726+ float charge = 0.0 ;
727+ TParticlePDG* pdgparticle = fPDG ->GetParticle (particle.pdgCode ());
728+ if (pdgparticle != nullptr ) {
729+ charge = (pdgparticle->Charge () / 3 >= 1 ) ? 1.0 : ((pdgparticle->Charge () / 3 <= -1 ) ? -1.0 : 0 );
765730 }
766- return - 1 ;
731+ return charge ;
767732}
768733
769734} // namespace identifiedbffilter
0 commit comments