StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
L2jetResults2009.h
1 #ifndef L2JETRESULTS2009_H
2 #define L2JETRESULTS2009_H
3 
4 /*********************************************************************
5  * $Id: L2jetResults2009.h,v 1.2 2010/04/18 06:05:39 pibero Exp $
6  * \author Jan Balewski, IUCF, 2006
7  *********************************************************************
8  * Descripion:
9  * Output container for di-jets reco in L2
10  * stored in the trigger data
11  *********************************************************************
12  */
13 
14 
15 #define L2JET_RESULTS_VERSION 4
16 
17 struct L2jetOutInt0 { // 4 bytes
18  unsigned char version; // to tag format of the L2Result
19  unsigned char decision; /* meaning of bits:
20  0-2 : useBtowEast, useBtowWest, useEtow,
21  3,4 : seenBtow, seenEtow data block
22  5: accepted at random
23  6: accepted by one-jet cuts
24  7: accept by di-jet cuts
25  */
26  unsigned char dumm; /* free */
27  unsigned char kTick; /* CPU ticks used for this event in kTicks,
28  255=overflow, */
29 };
30 
31 struct L2jetOutInt1 { // 4 bytes
32  unsigned short iTotEne; // total transverse energy Et/GeV=iEne/100.
33  unsigned char checkSum; // to monitor if I get what I wrote
34  unsigned char free;
35 };
36 struct L2jetOutInt2 { // 4 bytes
37  unsigned short nBtowTw; // # of working towers above ADC thres
38  unsigned short nEtowTw; // --//--
39 };
40 
41 struct L2jetOutJet { // 8 bytes, first & second jet
42  unsigned char jPhi; // phi index, [0:180], phi/deg=jPhi*2;
43  unsigned char jEta; // eta index, [0:149], etaValue=jEta/50.-1.
44  unsigned short iEne; // transverse energy Et/GeV=iEne/100.
45  unsigned short rmsEta; // units ???
46  unsigned short rmsPhi;// units ???
47 };
48 
49 struct L2jetResults2009{ // all output bits lump together
50  struct L2jetOutInt0 int0; //4
51  struct L2jetOutInt1 int1; //4
52  struct L2jetOutInt2 int2; //4
53  struct L2jetOutJet jet1, jet2; //8+8
54 };
55 
56 
57 //====================================
58 //====================================
59 // get value of n-th bit
60 #define GET_OB(x,n) ( (x & 1 << n)!=0 )
61 
62 inline void
63 L2jetResults2009_print(L2jetResults2009 *p) {
64  if(p==0) {printf("print L2jetResults2009 - NULL pointer ????\n"); return;}
65 
66  unsigned int x=p->int0.decision;
67  printf("L2jetResults2009:\n Accept: rnd=%d oneJet=%d diJet=%d \n useBtowEast=%d useBtowWest=%d useEndcap=%d bemcIn=%d eemcIn=%d\n", GET_OB(x,5), GET_OB(x,6), GET_OB(x,7), GET_OB(x,0), GET_OB(x,1), GET_OB(x,2), GET_OB(x,3), GET_OB(x,4));
68 
69  printf(" Jet1: Et/GeV=%.2f phi/deg=%3d eta=%.2f RMS: phi/deg=%.1f eta=%.2f\n", p->jet1.iEne/100.,p->jet1.jPhi*2,p->jet1.jEta/50.-1., p->jet1.rmsPhi/10.,p->jet1.rmsEta/100.);
70 
71  printf(" Jet2: Et/GeV=%.2f phi/deg=%3d eta=%.2f RMS: phi/deg=%.1f eta=%.2f\n", p->jet2.iEne/100.,p->jet2.jPhi*2,p->jet2.jEta/50.-1., p->jet2.rmsPhi/10.,p->jet2.rmsEta/100.);
72 
73  printf(" totEne/GeV=%.2f nBtowTw=%d nEtwTw=%d, \n CPU kTicks=%d format=%d checkSum=%d\n", p->int1.iTotEne/100., p->int2.nBtowTw, p->int2.nEtowTw, p->int0.kTick,p->int0.version, p->int1.checkSum);
74 
75 
76 };
77 
78 #undef GET_OB
79 
80 //====================================
81 //====================================
82 inline unsigned char
83 L2jetResults2009_doCheckSum(L2jetResults2009 *p) {
84  if(p==0) {printf("print L2jetResults2009 - NULL pointer ????\n"); return 0xff;}
85  unsigned char* buf=(unsigned char*) p;
86  int len=sizeof( L2jetResults2009);
87  unsigned char sum=0;
88  int i;
89  for(i=0;i<len;i++) sum+=buf[i];
90  return sum;
91 }
92 #endif
93 
94 /**********************************************************************
95  $Log: L2jetResults2009.h,v $
96  Revision 1.2 2010/04/18 06:05:39 pibero
97  Address compiler warnings.
98 
99  Revision 1.1 2010/04/17 05:04:13 pibero
100  Updates for Run 9 jet tree production
101 
102  Revision 1.2 2008/01/17 01:57:25 kocolosk
103  inline printing and checksum functions
104 
105  Revision 1.1 2007/10/11 00:33:20 balewski
106  L2algo added
107 
108  Revision 1.6 2006/03/28 19:46:49 balewski
109  ver16b, in l2new
110 
111  Revision 1.5 2006/03/11 17:08:34 balewski
112  now CVS comments should work
113 
114 */
115