SND@LHC Software
Loading...
Searching...
No Matches
RPCUnpack.cxx File Reference
#include <cassert>
#include "TClonesArray.h"
#include "FairRootManager.h"
#include "FairRunOnline.h"
#include "FairLogger.h"
#include "RPCUnpack.h"
#include "MuonTaggerHit.h"
#include "ShipOnlineDataFormat.h"
Include dependency graph for RPCUnpack.cxx:

Go to the source code of this file.

Classes

struct  RawHit
 

Enumerations

enum  Direction { horizontal = 0 , vertical = 1 }
 

Functions

int GetId (int ncrate, int nboard, int channel)
 

Enumeration Type Documentation

◆ Direction

enum Direction
Enumerator
horizontal 
vertical 

Definition at line 23 of file RPCUnpack.cxx.

23{ horizontal = 0, vertical = 1 };
@ vertical
Definition RPCUnpack.cxx:23
@ horizontal
Definition RPCUnpack.cxx:23

Function Documentation

◆ GetId()

int GetId ( int  ncrate,
int  nboard,
int  channel 
)

Definition at line 25 of file RPCUnpack.cxx.

26{
27 assert(ncrate == 16 || ncrate == 18);
28 assert(nboard > 0 && nboard < 16);
29 int station;
30 int nboardofstation;
31 switch (ncrate) {
32 case 16:
33 station = (nboard < 6) ? 1 : 2;
34 nboardofstation = nboard - (station - 1) * 5;
35 break;
36 case 18:
37 station = (nboard < 6) ? 3 : (nboard < 11) ? 4 : 5;
38 nboardofstation = nboard - (station - 3) * 5;
39 break;
40 }
41 int direction = (nboardofstation < 4) ? vertical : horizontal;
42 int strip = direction == vertical
43 ? channel - 3
44 : (channel < 16) ? 10 - channel
45 : (channel < 32) ? 42 - channel : (channel < 48) ? 74 - channel : 106 - channel;
46 strip += (nboardofstation - (direction == vertical ? 1 : 4)) * 64;
47 LOG(DEBUG) << ncrate << '\t' << nboard << '\t' << channel << '\t' << station << '\t' << strip << '\t'
48 << (direction == vertical ? 'V' : 'H');
49 return 10000 * station + 1000 * direction + strip;
50}