C ======================================================== SubRoutine PACELLgp(Operation,EnergyCuts,NrClus,IErr,icell) C ======================================================== C#------------------------------------------------------------------- C# C# Modified version for finding jets in Hadronic center of mass C# and particles (G.Cases: 10.7.94) C# C# SubRoutine PUCELL (Operation,EnergyCuts,NrClus,IErr) C# C@# PUCELL : Find jets using a cone algorithm in pseudorapidity-phi. C C# Find jets using a cone algorithm in pseudorapidity-phi. C# These kind of algorithms are generally used in p-pbar C# experiments (UA1/CDF). The jet is defined as a cone with C# fixed radius in pseudorapidity-azimuth space. The implemented C# version corresponds to the "Snowmass convention". C# Table Caltru is the starting point; results are stored in C# tables Cidclu and Cidcel. Position and energy are given, but not the C# class; this can be done using routine PCIdCl. Cuts on the energy of C# cells and cluster seeds can be applied. C# C# Calls routines CFILHA, CLUHAD, CEMPHA and CCLCOP from CCRECON. C# C# Author: Paul de Jong C# C# Input: C# Table Caltru (cells with energy) C# C# Real Operation(10) Steering parameters C# 1: Mode of operation C# <= 1. : E_T (d) C# > 1. : E C# 2: Precluster Cone Radius (0.7) C# 3: Cluster Cone Radius (0.7) C# 4: Maximum number of iterations (20) C# 5: Minimum overlap fraction for merge (0.75) C# 6-10 ineffective C# values < 0. : default taken C# C# Real EnergyCuts(10) (in GeV) C# 1: EMC cell energy cut (0.03) C# 2: HAC cell energy cut (0.08) C# 3: Seed cell energy (E_T) cut (1.0 (0.3)) C# 4-10 ineffective C# values < 0. : default taken C# C# Output C# Table Cidclu (clusters, no 'class') C# C# Table Cidcel (link cells-clusters) C# C# NrClus : number of clusters found C# C# IErr : error flag C# 0: no error C# 1: geometry not set up properly C# 2: error during clustering C# C# Restrictions: CAL geometry set up a la CCGEOM needed. C# The CCRECON library needs to be linked. C# Block Data CCBLDA required. C# C# Documentation: ZEUS-Note 92-019 C# C# Default parameters and cuts can be chosen by setting them to C# negative values: CALL VFILL (EnergyCuts,10,-1.) C# CALL VFILL (Operation,10,-1.) C# C#------------------------------------------------------------------- C ======================================================== Implicit None C #include "caltru.inc" #include "cucell.inc" #include "ccadja.inc" #include "cidclu.inc" #include "cidcel.inc" #include "clucom.inc" #include "clupar.inc" #include "cluout.inc" #include "cfound.inc" #include "cdfcom.inc" #include "cclust.inc" #include "partap.inc" #include "zdskey.inc" C Integer I, NrClus, IErr, MyErr Character*4 Modes(2) Real EnergyCuts(10), Operation(10) Logical OK, Lprint, First Data Modes / 'E_T' , 'E' / Data Lprint,First /.TRUE., .TRUE./ integer icell Character*4 AnyName, GenKey Save GenKey c c c if (FIRST) then Call DefGen(GenKey) endif First=.FALSE. C C Check geometry C NrClus = 0 IErr = 0 Call CleTab (Cidclu) Call CleTab (Cidcel) C C Overrule steering parameters and energy cuts. C If (Operation(1).GE.0.) Then If (Operation(1).LE.1.) Then Imode = 1 Else Imode = 2 Endif Endif If (Operation(2).GE.0.) RadPC = Operation(2) If (Operation(3).GE.0.) Radius = Operation(3) C .. Some protection might be needed here If (RadPC.LT.0.1) Then RadPC = 0.1 Write (6,*) ' PUCELL warning: Precluster radius set to ',RadPC Endif If (Radius.LT.0.1) Then Radius = 0.1 Write (6,*) ' PUCELL warning: Cluster radius set to ',Radius Endif If (RadPC.GT.Radius) Then RadPC = Radius Write (6,*) ' PUCELL warning: precluster radius set to ',RadPC Endif If (Radius/RadPC.GT.3.) Then RadPC = Radius/3. Write (6,*) ' PUCELL warning: precluster radius set to ',RadPC Endif If (Operation(4).GE.0.) MaxIter = Int(Operation(4)) If (MaxIter.LT.1) MaxIter=1 If (Operation(5).GE.0.) Frac = Operation(5) If (Frac.GT.1.) Frac=1. If (EnergyCuts(1).GE.0.) Emcccut = EnergyCuts(1) If (EnergyCuts(2).GE.0.) Hacccut = EnergyCuts(2) If (EnergyCuts(3).GE.0.) Then If (Imode.EQ.1) Then EtSeedcut = EnergyCuts(3) EtSneedcut = 0.0001 Else ESeedcut = EnergyCuts(3) ESneedcut = 0.0001 Endif Endif C C Protect against absolute zero C If (Emcccut.LE.0.) Emcccut = 0.0001 If (Hacccut.LE.0.) Hacccut = 0.0001 If (EtSeedcut.LE.0.) EtSeedcut = 0.0001 If (ESeedcut.LE.0.) ESeedcut = 0.0001 C C First time: print some info C If (Lprint) Then Lprint = .FALSE. Write(6,1000) Write(6,1001) Modes(Imode),RadPC,Radius,MaxIter,Frac If (Imode.LE.1) Then Write(6,1002) Emcccut, Hacccut, EtSeedcut Else Write(6,1002) Emcccut, Hacccut, ESeedcut Endif Endif C C Fill common block C Call CFilpagp (icell,MyErr) If (MyErr.NE.0) Then IErr = 2 Write (6,*) ' PACEgp reports error ',MyErr,' in CFilPAHa' Return Endif C C Perform the jet finding C Call CluHad (NrClus,MyErr) If (MyErr.NE.0) Then IErr = 2 Write (6,*) ' PACEgp reports error ',MyErr,' in CLUHad' Return Endif C---- call Convpagp(Nrclus,Myerr) If (MyErr.NE.0) Then IErr = 2 Write (6,*) ' PUCEgp reports error ',MyErr,' in Convpagp' Return Endif c c Return C 1000 Format(////, , 7X,' PUCEgp searches for jets with cone algorithm',/, , 7X,'----------------------------------------------',/) 1001 Format(/, , 6X,'Clustering in E_T or E : ................ ',A4,/, , 6X,'Precluster cone radius .................. ',F8.3,/, , 6X,'Jet cone radius ......................... ',F8.3,/, , 6X,'Maximum number of iterations ............ ',I8,/, , 6X,'Minimum energy fraction for merge ....... ',F8.3) C 1002 Format(/, , 6X,'The following energy cuts are applied: ',/, , 6X,'EMC cell energy cut ..................[GeV]',F8.3,/, , 6X,'HAC cell energy cut ..................[GeV]',F8.3,/, , 6X,'Cluster seed cell energy cut .........[GeV]',F8.3) C End c--------------------