[Halld-offline] pythia event filter

Alexander Somov somov at jlab.org
Mon Mar 22 18:41:41 EDT 2010


Hi Will,

You can filter event on the generator (bggen) level,
i.e., write to an hddm file only decays of interest
and then process them through Geant.

You have to edit
Simulation/bggen/code/bg_eve.F

file and recompile bggen.

Below is an example how to select events
with  "p eta" in the final state and write
them (only) to an hddm file.

Let me know if you decide to use this method
and have any further questions.

Good luck.

Cheers,
        Sascha






INTEGER WRITE_TMP
INTEGER SEL_ETA, SEL_PROT, SEL_N_TR


C Find "Output file for HDDM" in the code
C and add
C
C---   Output file for HDDM
C

       SEL_ETA     =  0
       SEL_PROT    =  0
       SEL_N_TR    =  0

-----


C	LOOP OVER ALL GENERATED PARTICLES
       DO i=1,NTRA


C	PROTON
         IF(ITPTRA(1,i).EQ.14) THEN
            SEL_PROT = SEL_PROT + 1
         ENDIF

C 	ETA
          IF(ITPTRA(1,i).EQ.17) THEN
             SEL_ETA = SEL_ETA + 1
          ENDIF

C	TOTAL
          IF(ITPTRA(1,i).GT.0) THEN
              SEL_N_TR = SEL_N_TR + 1
          ENDIF
     ENDDO


C     P ETA FOUND
     IF((SEL_N_TR.EQ.2).AND.(SEL_PROT.EQ.1).AND.
       +     (SEL_ETA.EQ.1)) THEN
          WRITE_TMP = 1
     ENDIF



C    WRITE ONLY  "P ETA"  EVENTS TO THE HDDM FILE
C    JUST ADD "IF"  STATEMENT HERE

      IF(WRITE_TMP.EQ.1) THEN
             CALL WRITE_HDDM_EVENT(IEVENT,IEVPROC
      +           ,ifl1(1,1),ptmp1(1,1)
      +           ,NTRA,ifl2(1,1),ptmp2(1,1))
      ENDIF


....








On Mon, 22 Mar 2010, Will Levine wrote:

> Hi,
> I'm looking for a way to filter out all events of a specific final
> states from bggen/pythia output. Curtis said there had been some
> discussion of this, so I was hoping someone could help me out.
>
> Thanks,
> Will
> _______________________________________________
> Halld-offline mailing list
> Halld-offline at jlab.org
> https://mailman.jlab.org/mailman/listinfo/halld-offline
>




More information about the Halld-offline mailing list