Actual digitization of all hits in the ECL. 
  148   eclPrimaryMap.clear();
 
  151   for (
int iPart = 0; iPart < nParticles ; ++iPart) {
 
  152     if (mcParticles[iPart]->getMother() == NULL) {
 
  165         && adhoc_StableInGeneratorFlag) {
 
  166       if (mcParticles[iPart]->getArrayIndex() == -1) {
 
  167         eclPrimaryMap.insert(pair<int, int>(iPart, iPart));
 
  169         eclPrimaryMap.insert(pair<int, int>(mcParticles[iPart]->getArrayIndex(), mcParticles[iPart]->getArrayIndex()));
 
  172       if (mcParticles[iPart]->getMother() == NULL) 
continue;
 
  173       if (eclPrimaryMap.find(mcParticles[iPart]->getMother()->getArrayIndex()) != eclPrimaryMap.end()) {
 
  174         eclPrimaryMap.insert(
 
  175           pair<int, int>(mcParticles[iPart]->getArrayIndex(), eclPrimaryMap[mcParticles[iPart]->getMother()->getArrayIndex()]));
 
  186   RelationArray trgeclDigi0ToMCPart(trgeclDigi0Array, mcParticles);
 
  187   int nHits_hit = eclHitArray.getEntries() - 1;
 
  191   const int NofTCDigiHit = trgeclDigi0Array.
getEntries();
 
  195   for (
int ii = 0; ii < NofTCDigiHit; ii++) {
 
  202     int itimeindex = (int)(
TCRawTiming[ihit] / 100 + 40);
 
  205     for (
int hit = 0; hit < nHits_hit; hit++) {
 
  207       ECLHit* aECLHit =  eclHitArray[hit];;
 
  210       if (hitE < 0.1) {
continue;} 
 
  211       int hitCellId         = aECLHit->
getCellId() - 1;
 
  213       int timeindex = (int)((aECLHit ->getTimeAve()) / 100 + 40);
 
  216       if (hitTCId != 
TCId[ihit]) {
continue;}
 
  217       if (itimeindex != timeindex) {
continue;}
 
  227         XtalId[ihit][0] = hitCellId ;
 
  237         XtalId[ihit][1] = hitCellId ;
 
  246         XtalId[ihit][2] = hitCellId ;
 
  252     for (
int index = 0; index < eclHitRel.getEntries(); index++) {
 
  253       int PrimaryIndex = -1;
 
  255       map<int, int>::iterator iter = eclPrimaryMap.find(eclHitRel[index].getFromIndex());
 
  257       if (iter != eclPrimaryMap.end()) {
 
  258         PrimaryIndex = iter->second;
 
  260       int eclhitRelSize = eclHitRel[index].getToIndices().size();
 
  261       for (
int pri_hit = 0; pri_hit <  eclhitRelSize ; pri_hit++) {
 
  262         int ieclHitRel = eclHitRel[index].getToIndex(pri_hit);
 
  263         if (
ieclhit[ihit][0] == ieclHitRel) {
 
  267         if (
ieclhit[ihit][1] == ieclHitRel) {
 
  271         if (
ieclhit[ihit][2] == ieclHitRel) {
 
  298         mclist =  mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()-> getIndex();
 
  300       if (mclist != 1 && 
mother[ihit][0] != 0 && (mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother())) {
 
  302         mclist =  mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother()-> getIndex();
 
  305       if (mclist != 1 && 
gmother[ihit][0] != 0 && (mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother()->getMother())) {
 
  306         ggmother[ihit][0] =  mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother()->getMother() ->getPDG();
 
  307         mclist =  mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother()->getMother()-> getIndex();
 
  311       if (mclist != 1 && 
ggmother[ihit][0] != 0) {
 
  312         if (mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother()->getMother()->getMother()) {
 
  313           gggmother[ihit][0] =  mcParticles[
TCPrimaryIndex[ihit][0]]->getMother()->getMother()->getMother()->getMother() ->getPDG();
 
  329         mclist = mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()-> getIndex();
 
  331       if (mclist != 1 && 
mother[ihit][1] != 0 && (mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother())) {
 
  333         mclist =  mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother()-> getIndex();
 
  336       if (mclist != 1 && 
gmother[ihit][1] != 0 && (mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother()->getMother())) {
 
  337         ggmother[ihit][1] =  mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother()->getMother() ->getPDG();
 
  338         mclist =  mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother()->getMother()-> getIndex();
 
  340       if (mclist != 1 && 
ggmother[ihit][1] != 0) {
 
  341         if (mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother()->getMother()->getMother()) {
 
  342           gggmother[ihit][1] =  mcParticles[
TCPrimaryIndex[ihit][1]]->getMother()->getMother()->getMother()->getMother() ->getPDG();
 
  356         mclist = mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()-> getIndex();
 
  358       if (mclist != 1 && 
mother[ihit][2] != 0 && (mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother())) {
 
  360         mclist =  mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother()-> getIndex();
 
  363       if (mclist != 1 && 
gmother[ihit][2] != 0 && (mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother()->getMother())) {
 
  364         ggmother[ihit][2] =  mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother()->getMother() ->getPDG();
 
  365         mclist =  mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother()->getMother()-> getIndex();
 
  367       if (mclist != 1 && 
ggmother[ihit][2] != 0) {
 
  368         if (mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother()->getMother()->getMother()) {
 
  369           gggmother[ihit][2] =  mcParticles[
TCPrimaryIndex[ihit][2]]->getMother()->getMother()->getMother()->getMother() ->getPDG();
 
  380   for (
int ii = 0; ii < ihit; ++ii) {
 
  386     TCDigiArray[m_hitNum]->setEventId(
m_nEvent);
 
  387     TCDigiArray[m_hitNum]->setTCId(
TCId[ii]);
 
  389     TCDigiArray[m_hitNum]->setRawEnergy(
TCRawEnergy[ii]);
 
  390     TCDigiArray[m_hitNum]->setRawTiming(
TCRawTiming[ii]);
 
  391     TCDigiArray[m_hitNum]->setTrackId(
trackId[ii]);
 
  392     TCDigiArray[m_hitNum]->setCellId(
XtalId[ii]);
 
  394     TCDigiArray[m_hitNum]->setPDG(
pid[ii]);
 
  395     TCDigiArray[m_hitNum]->setMother(
mother[ii]);
 
  396     TCDigiArray[m_hitNum]->setGMother(
gmother[ii]);
 
  397     TCDigiArray[m_hitNum]->setGGMother(
ggmother[ii]);
 
  398     TCDigiArray[m_hitNum]->setGGGMother(
gggmother[ii]);
 
  400     TCDigiArray[m_hitNum]->setPX(
px[ii]);
 
  401     TCDigiArray[m_hitNum]->setPY(
py[ii]);
 
  402     TCDigiArray[m_hitNum]->setPZ(
pz[ii]);
 
  403     TCDigiArray[m_hitNum]->setMCEnergy(
MCEnergy[ii]);
 
  404     TCDigiArray[m_hitNum]->setContribution(
contribution[ii]);
 
  413   RelationArray trgeclHitToMCPart(trgeclHitArray, mcParticles);
 
  414   const int NofTCHit = trgeclHitArray.
getEntries();
 
  417   for (
int ii = 0; ii < NofTCHit; ++ii) {
 
  419     TRGECLHit* aTRGECLHit = trgeclHitArray[ii];
 
  423     int itimeindex = (int)(
TCHitTiming[ii] / 100 + 40);
 
  425     for (
int index = 0; index < trgeclDigi0ToMCPart.getEntries(); ++index) {
 
  427       int idigitimeindex = (int)(
TCRawTiming[idigi] / 100 + 40);
 
  429       if (itimeindex != idigitimeindex) {
continue;}
 
  490   for (
int ii = 0; ii < trgeclHitArray.
getEntries(); ++ii) {
 
  494     TCHitArray[m_hitNum]->setEventId(
m_nEvent);
 
  495     TCHitArray[m_hitNum]-> setTCId(
TCIdHit[ii]);
 
  496     TCHitArray[m_hitNum]->setCellId(
XtalIdHit[ii]);
 
  497     TCHitArray[m_hitNum]->setEnergyDep(
TCHitEnergy[ii]);
 
  498     TCHitArray[m_hitNum]-> setTimeAve(
TCHitTiming[ii]);
 
  499     TCHitArray[m_hitNum]-> setTrackId(
trackIdHit[ii]);
 
  500     TCHitArray[m_hitNum]-> setPDG(
pidHit[ii]);
 
  501     TCHitArray[m_hitNum]->setMother(
motherHit[ii]);
 
  502     TCHitArray[m_hitNum]->setGMother(
gmotherHit[ii]);
 
  503     TCHitArray[m_hitNum]->setGGMother(
ggmotherHit[ii]);
 
  505     TCHitArray[m_hitNum]->setPX(
pxHit[ii]);
 
  506     TCHitArray[m_hitNum]->setPY(
pyHit[ii]);
 
  507     TCHitArray[m_hitNum]->setPZ(
pzHit[ii]);
 
  508     TCHitArray[m_hitNum]->setMCEnergy(
MCEnergyHit[ii]);
 
Class to store simulated hits which equate to average of ECLSImHit on crystals input for digitization...
int getCellId() const
Get Cell ID.
double getEnergyDep() const
Get deposit energy.
double pz[100][3]
Momentum Z of particle.
double BKGContribution[100]
Backgroun Contribution in a TC
int background_tag[100][3]
Beam background tag.
int gmotherHit[100][3]
Grand mother ID
double contributionHit[100][3]
particles contribution
int pidHit[100][3]
Particle ID.
double pxHit[100][3]
Momentum X of particle.
int ggmother[100][3]
Grand Grand Mother ID
double MCEnergy[100][3]
Raw Energy of particle
double SignalContribution[100]
Signal Contibution in a TC.
double contribution[100][3]
particles contribution
double py[100][3]
Momentum Y of particle.
double BKGContributionHit[100]
Backgroun Contribution in a TC
int gggmotherHit[100][3]
Grand Grand Grand Mother ID
int gmother[100][3]
Grand mother ID
double TCHitEnergy[100]
TC Hit energy
int TCPrimaryIndexHit[100][3]
Primary Index in TC hit
double pzHit[100][3]
Momentum X of particle.
double MCEnergyHit[100][3]
Raw Energy of particle
double SignalContributionHit[100]
Signal Contibution in a TC.
int pid[100][3]
Particle ID.
int ggmotherHit[100][3]
Grand Grand Mother ID
int TCPrimaryIndex[100][3]
Primary Index in TC hit
int mother[100][3]
Mother ID
int XtalId[100][3]
XtalId in TC
int m_nEvent
Event number.
int gggmother[100][3]
Grand Grand Grand Mother ID
double maxEnergy[100][3]
Energy of maximum contribtion particle
double TCRawEnergy[100]
TC raw energy.
int motherHit[100][3]
Mother ID
int trackId[100][3]
Track Id.
int background_tagHit[100][3]
Beam background tag.
int ieclhit[100][3]
eclhit id
double pyHit[100][3]
Momentum X of particle.
double TCHitTiming[100]
TC Hit Timking
std::map< int, int > PrimaryTrackMap
define a map for Primary Track
int XtalIdHit[100][3]
XtalId in TC
double TCRawTiming[100]
TC raw timing.
int trackIdHit[100][3]
Track Id.
double px[100][3]
Momentum X of particle.
TrgEclMapping * _TCMap
object of TC Mapping
@ c_PrimaryParticle
bit 0: Particle is primary particle.
@ c_StableInGenerator
bit 1: Particle is stable, i.e., not decaying in the generator.
Low-level class to create/modify relations between StoreArrays.
virtual unsigned short getBackgroundTag() const
Get background tag.
T * appendNew()
Construct a new T object at the end of the array.
int getEntries() const
Get the number of objects in the array.
Raw TC result nefor digitizing.
double getRawTiming() const
Get raw TC timing.
int getTCId() const
Get TC id.
double getRawEnergy() const
Get Energy and Timing Get raw TC energy.
double getTimeAve() const
The method to get hit average time.
int getTCId() const
The method to get TC id.
int getTCIdFromXtalId(int)
get [TC ID] from [Xtal ID]
static const double GeV
Standard of [energy, momentum, mass].