StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcClusterMaker.cxx
1 
48 #include "StEEmcClusterMaker.h"
49 
50 #include <algorithm>
51 #include <iostream>
52 
53 #include "TMath.h"
54 
55 /* StEvent stuff */
56 #include "StEvent/StEvent.h"
57 #include "StEvent/StEmcCollection.h"
58 #include "StEvent/StEmcDetector.h"
59 #include "StEvent/StEmcModule.h"
60 #include "StEvent/StEmcClusterCollection.h"
61 #include "StEvent/StEmcCluster.h"
62 
63 #define DEBUG 0
64 
65 ClassImp(StEEmcClusterMaker);
66 
67 // ----------------------------------------------------------------------------
69 {
70 
72  mFillStEvent = 0;
73 
75  mSuppress = 0;
76 
77  mLoose=false;
78  mSkip=true;
79 
82  mClusterId = 0;
83 
85  const Float_t eseeds[] = { 0.6, 1.0/1000, 1.0/1000, 1.0/1000., 0.3/1000., 0.3/1000. };
86  for ( Int_t i = 0; i < 6; i++ ) seedEnergy( eseeds[i], i );
87 
88  mMaxExtent = 6;
89  mSeedFloor = 2.0;
90 
103 
104  StEEmcClusterVec_t t;
105  std::vector< StEEmcClusterVec_t > layers;
106  for ( Int_t i = 0; i < 4; i++ ) layers.push_back(t);
107  for ( Int_t i = 0; i < 12; i++ ) mTowerClusters.push_back(layers);
108 
109  StEEmcSmdClusterVec_t s;
110  std::vector< StEEmcSmdClusterVec_t > planes;
111  planes.push_back(s);
112  planes.push_back(s);
113  for ( Int_t i = 0; i < 12; i++ ) mSmdClusters.push_back(planes);
114 
115  StEEmcTowerVec_t tow;
116  std::vector< StEEmcTowerVec_t > lay;
117  for ( Int_t i = 0; i < 4; i++ ) lay.push_back(tow);
118  for ( Int_t i = 0; i < 12; i++ ) mSeedTowers.push_back(lay);
119 
120  mEEtow=new EEmcGeomSimple();
121  mEEsmd=EEmcSmdGeom::instance();
122  mEEmap=EEmcSmdMap::instance();
123 
124  mMinStrips=3;
125 
126 }
127 
128 // ----------------------------------------------------------------------------
130 {
131  mEEanalysis=(const StEEmcA2EMaker*)GetMaker(mAnalysisName);
132  assert(mEEanalysis);
133 
134  return StMaker::Init();
135 }
136 
137 // ----------------------------------------------------------------------------
139 {
140  StMaker::Make();
142  if ( !buildTowerClusters() ) return kStWarn;
143 
145  if ( !buildSmdClusters() ) return kStWarn;
146 
148  if ( mFillStEvent ) fillStEvent();
149 
151  if ( mFillStEvent )
152  if ( !verifyStEvent() ) Warning("Make","StEvent not properly copied");
153 
154  return kStOK;
155 }
156 
157 // ----------------------------------------------------------------------------
158 void StEEmcClusterMaker::Clear( Option_t *opts )
159 {
160  StMaker::Clear();
162  for ( Int_t sector=0; sector<12; sector++ ) {
163  for ( Int_t layer=0; layer<4; layer++ )
164  mTowerClusters[sector][layer].clear();
165  for ( Int_t plane=0; plane<2; plane++ )
166  mSmdClusters[sector][plane].clear();
167  }
168 
169  for ( Int_t i=0;i<6;i++ ) mNumberOfClusters[i]=0;
170 
171  mClusterId = 0;
172 
173  return;
174 }
175 
176 
177 // ----------------------------------------------------------------------------
179 {
180 
183  //static const Int_t layer=0;
184 
185 
187  for ( Int_t layer=0;layer<4;layer++)
188  {
189 
192  Float_t weights[720]; for ( Int_t i=0;i<720;i++ ) weights[i]=0.;
193 
195  StEEmcClusterVec_t myClusters;
196 
197 
199  StEEmcTowerVec_t towers = mEEanalysis -> towers( layer );
200 
201 
202 
204  std::sort(towers.begin(),towers.end());
206  std::reverse(towers.begin(),towers.end());
207 
208 
211  StEEmcTowerVec_t::iterator last = towers.begin();
212  while ( last != towers.end() ) {
213 
214  if ( (*last).energy() < mSeedEnergy[layer] ) break;
219  //$$$ mSeedTowers[layer][ (*last).sector() ].push_back((*last));
220 #if DEBUG
221  std::cout << "-- Seed tower ----------------------" << std::endl;
222  (*last).print();
223 #endif
224  last++;
225  }
226 
227  StEEmcTowerVec_t::iterator iter = towers.begin();
228  while ( iter != towers.end() ) {
229 
231  if ( iter==last ) break;
232 
233 
240  if ( weights[ (*iter).index() ] > 0. ) {
241  iter++;
242  continue;
243  }
244 
247  for ( Int_t in=0; in < (*iter).numberOfNeighbors(); in++ ) {
248  StEEmcTower t=(*iter).neighbor(in);
249  weights[ t.index() ] += (*iter).energy();
250  }
251 
252 
253  iter++;
254 
255  }// loop over towers to init weights
256 
257 
259  iter=towers.begin();
260  while ( iter != towers.end() ) {
261 
263  if ( iter==last ) break;
264 
268  if ( weights[ (*iter).index() ] > 0. ) {
269  iter++;
270  continue;
271  }
272 
274  StEEmcTower seed=(*iter);
275 #if DEBUG
276  std::cout << "--- Clustering ----------------" << std::endl;
277  seed.print();
278 #endif
279 
280  TVector3 momentum;
281  cluster.add(seed,1.0);
282  UInt_t sec,sub,eta;
283  sec=(UInt_t)seed.sector();
284  sub=(UInt_t)seed.subsector();
285  eta=(UInt_t)seed.etabin();
286  TVector3 d=mEEtow->getTowerCenter(sec,sub,eta).Unit();
287  momentum += ( seed.energy() * d );
288 
289  for ( Int_t in=0; in<seed.numberOfNeighbors(); in++ ) {
290  StEEmcTower t=seed.neighbor(in);
291  sec=(UInt_t)t.sector();
292  sub=(UInt_t)t.subsector();
293  eta=(UInt_t)t.etabin();
294  d=mEEtow->getTowerCenter(sec,sub,eta).Unit();
295  Float_t weight = seed.energy() / weights[ t.index() ];
296  momentum += ( t.energy() * d * weight );
297  cluster.add(t, weight);
298 #if DEBUG
299  std::cout << "adding " << t.name() << " E=" << t.energy() << " W=" << weight << std::endl;
300 #endif
301  }
302 
303 
305  cluster.momentum( momentum );
306  cluster.key( mClusterId++ );
307 #if DEBUG
308  cluster.print();
309 #endif
310 
311  mTowerClusters[ seed.sector() ][ layer ].push_back( cluster );
312  mNumberOfClusters[layer]++;
313 
314  iter++;
315 
316  }
317 
318  }// end of eventual loop over layers
319 
320 
321  return true;
322 
323 }
324 
325 // ----------------------------------------------------------------------------
327 {
328 
329  Int_t max_extent = mMaxExtent;
330 
332  for ( Int_t sector=0; sector<12; sector++ )
334  for ( Int_t plane=0; plane<2; plane++ ) {
335 
337  Float_t floor[288]; for ( Int_t i=0; i<288; i++ ) floor[i]=0.;
338 
340  StEEmcStripVec_t strips=mEEanalysis->strips(sector,plane);
341  StEEmcStripVec_t seeds;
343  std::sort(strips.begin(),strips.end());
345  std::reverse(strips.begin(),strips.end());
346 
348  std::vector<Bool_t> seed_flags( strips.size(), false );
349 
350 
352  Int_t nstrip=0;
353  Int_t nseeds=0;
354  StEEmcStripVec_t::iterator istrip=strips.begin();
355  while ( istrip!=strips.end() ) {
356 
357  Int_t index=(*istrip).index();
358  Float_t eseed=(*istrip).energy();
359 
361  if ( index <= 3 || index >= 283 ) {
362  istrip++;
363  nstrip++;
364  continue;
365  }
366 
368  if ( mSkip )
369  if ( (*istrip).fail() ) {
370  istrip++;
371  nstrip++;
372  continue;
373  }
374 
375 
378  if ( eseed < mSeedFloor*floor[ index ] + mSeedEnergy[4+plane] ) {
379  istrip++;
380  nstrip++;
381  continue;
382  }
383 
385  seeds.push_back( (*istrip) );
386  nstrip++;
387  nseeds++;
388 
389 
395 #ifndef LOOSE_CUTS
396  for ( Int_t i=0; i < 288; i++ ) {
398  Int_t dx=TMath::Abs(index-i);
400  if ( dx<3 )
401  if ( eseed > floor[i] ) floor[i]=eseed;
403  if ( dx<5 )
404  if ( 0.20 * eseed > floor[i] ) floor[i] = 0.2 * eseed;
406  if ( dx<11 )
407  if ( 0.10 * eseed > floor[i] ) floor[i] = 0.1 * eseed;
409  if ( dx<21 )
410  if ( 0.20*eseed > floor[i] ) floor[i] = 0.05 * eseed;
411  }
412 #else
413  for ( Int_t i=0; i < 288; i++ ) {
415 
416  Int_t dx=TMath::Abs(index-i);
417 
419  if ( dx<7 )
420  if ( 0.05 * eseed > floor[i] ) floor[i] = 0.05 * eseed;
421 
422  }
423 #endif
424  istrip++;
425 
426  }// found all seed strips
427 
433  Bool_t owned[288]; for (Int_t i=0;i<288;i++) owned[i]=false;
434  Bool_t xseed[288]; for (Int_t i=0;i<288;i++) xseed[i]=false;
435 
436  StEEmcStripVec_t::iterator iseed=seeds.begin();
437  while ( iseed != seeds.end() ) {
438 
440  Int_t index=(*iseed).index();
441  if ( owned[index] || (mSuppress&&xseed[index]) ) {
442  iseed++;
443  continue;
444  }
445 
447  owned[index]=true;
448  xseed[index]=true;
452  cluster.add( (*iseed) );
453 
454  Int_t ind_max = TMath::Min(287,index+max_extent);
455  Int_t ind_min = TMath::Max(0, index-max_extent);
456 
459  for ( Int_t i=index+1; i<=ind_max; i++ ) {
461  StEEmcStrip strip=mEEanalysis->strip(sector,plane,i);
463 
464  if ( mSkip ) {
465  if (strip.energy()<=0.&&!strip.fail()) break;
466  } else {
467  if ( strip.energy()<=0. ) break;
468  }
469 
471  owned[ strip.index() ] = true;
472  xseed[ strip.index() ] = true;
474  cluster.add(strip);
475  }
476  for ( Int_t i=index-1; i>=ind_min; i-- ) {
478  StEEmcStrip strip=mEEanalysis->strip(sector,plane,i);
480 
481  if ( mSkip ) {
482  if (strip.energy()<=0.&&!strip.fail()) break;
483  } else {
484  if (strip.energy()<=0.) break;
485  }
486 
488  owned[ strip.index() ] = true;
489  xseed[ strip.index() ] = true;
491  cluster.add(strip);
492  }
493 
495  if ( cluster.size() >= mMinStrips ) {
496  cluster.key( mClusterId++ );
497  mSmdClusters[ sector ][ plane ].push_back(cluster);
498  mNumberOfClusters[4+plane]++;
499 
500  // disallow strips on either side of the cluster
501  // from forming seeds
502  Int_t ns=cluster.numberOfStrips();
503  Int_t left=999,right=-999;
504  for ( Int_t is=0;is<ns;is++ )
505  {
506  StEEmcStrip s=cluster.strip(is);
507  if ( s.index()<left ) left=s.index();
508  if ( s.index()>right ) right=s.index();
509  }
510  /*
511  xseed[left-1]=true;
512  xseed[left-2]=true;
513  xseed[right+1]=true;
514  xseed[right+2]=true;
515  */
516  for ( Int_t ii=0;ii<=mSuppress;ii++ )
517  {
518  if ( left-ii>=0 ) xseed[left-ii] = true;
519  if ( right+ii<288 ) xseed[right+ii]= true;
520  }
521 
522  }
523 
524 
525  iseed++;
526  }
527 
528  }// loop over planes/sectors
529 
530  return true;
531 
532 }
533 
534 
535 
536 // ----------------------------------------------------------------------------
537 
539 {
540 
541  StEvent *stevent=(StEvent*)GetInputDS("StEvent");
542  if ( !stevent ) {
543  Warning("fillStEvent","called, but no StEvent to be found");
544  return;
545  }
546 
547  std::cout << "Adding tower clusters to StEvent at " << stevent << std::endl;
548 
552  StEmcDetector *detector=stevent->emcCollection()->detector(kEndcapEmcTowerId);
553  if ( !detector )
554  {
555  Warning("fillStEvent","detector == NULL, MAJOR StEvent problem, continuing");
556  return;
557  }
558 
559 
567 
568  if ( mNumberOfClusters[0] > 0 )
569  {
570 
571 
576  StEmcClusterCollection *collect = detector -> cluster();
577  if ( !collect )
578  {
579  //Warning("fillStEvent","StEmcClusterCollection (towers) was NULL, so I'm creating one.");
580  collect = new StEmcClusterCollection();
581  detector->setCluster( collect );
582  }
583 
584  assert(collect);
585  collect->setDetector( kEndcapEmcTowerId );
586  collect->setClusterFinderId( 123 );
587  collect->setClusterFinderParamVersion( 123 );
588 
590  for ( Int_t isector=0; isector<12; isector++ )
591  {
592 
594  for ( UInt_t iclust=0; iclust<mTowerClusters[isector][0].size(); iclust++ )
595  {
596 
597  StEEmcCluster cl=(mTowerClusters[isector][0])[iclust];
598 
602  StEmcCluster *emccluster = new StEmcCluster();
603  emccluster->setEta( cl.momentum().Eta() );
604  emccluster->setPhi( cl.momentum().Phi() );
605  emccluster->setSigmaEta(-1.);
606  emccluster->setSigmaPhi(-1.);
607  emccluster->setEnergy( cl.energy() );
608  emccluster->SetUniqueID( cl.key() );
609 #if 1
610  for ( Int_t i=0; i< cl.numberOfTowers(); i++ )
611  {
612  StEmcRawHit *hit=cl.tower(i).stemc();
613  assert( hit );
614  emccluster->addHit( hit );
615  }
616 #endif
617 
618  collect->addCluster( emccluster );
619 
620 
622  mEtoEE[ emccluster ] = cl;
623  cl.stemc( emccluster );
624 
625  }
626 
627  }
628 
629  }
630 
631  else // if ( mNumberOfClusters[0] == 0 )
632  {
633 
634  detector->setCluster( NULL );
635 
636  }
637 
638 
639 
640 
642  // detector->setCluster( collect );
643 
647  detector=stevent->emcCollection()->detector(kEndcapEmcPreShowerId);
648  if ( !detector )
649  {
650  Warning("fillStEvent","detector == NULL for pre/post, no clusters for you");
651  }
652  else if ( mNumberOfClusters[1] > 0 ||
653  mNumberOfClusters[2] > 0 ||
654  mNumberOfClusters[3] > 0 )
655  {
656 
657  StEmcClusterCollection *pqr = detector -> cluster();
658  if ( !pqr )
659  {
660  //Warning("fillStEvent","StEmcClusterCollection (pre/post) was NULL, so I'm creating one.");
661  pqr = new StEmcClusterCollection();
662  detector->setCluster( pqr );
663  }
664  assert(pqr);
665  pqr -> setDetector( kEndcapEmcPreShowerId );
666  pqr -> setClusterFinderId( 123 );
667  pqr -> setClusterFinderParamVersion( 321 );
668 
670  for ( Int_t isector=0; isector<12; isector++ )
671 
673  for ( Int_t ilayer=1; ilayer<4; ilayer++ )
674 
676  for ( UInt_t iclust=0; iclust<mTowerClusters[isector][ilayer].size(); iclust++ )
677  {
678 
679  StEEmcCluster cl=(mTowerClusters[isector][ilayer])[iclust];
680 
684  StEmcCluster *emccluster = new StEmcCluster();
685  emccluster->setEta( cl.momentum().Eta() );
686  emccluster->setPhi( cl.momentum().Phi() );
687  emccluster->setSigmaEta(-1.);
688  emccluster->setSigmaPhi(-1.);
689  emccluster->setEnergy( cl.energy() );
690  emccluster->SetUniqueID( cl.key() );
691 #if 1
692  for ( Int_t i=0; i< cl.numberOfTowers(); i++ )
693  {
694  StEmcRawHit *hit=cl.tower(i).stemc();
695  assert( hit );
696  emccluster->addHit( hit );
697  }
698 #endif
699 
700 
701  pqr->addCluster( emccluster );
702 
703  mEtoEE[ emccluster ] = cl;
704  cl.stemc( emccluster );
705 
706  }
707 
708  }
709  else // if ( mNumberOfClusters[1, 2 OR 3] == 0 )
710  {
711 
712  detector->setCluster( NULL );
713 
714  }
715 
716 
720  StDetectorId ids[]={ kEndcapSmdUStripId, kEndcapSmdVStripId };
721 
722 
723  for ( Int_t iplane=0; iplane<2; iplane++ )
724  {
725 
726  detector=stevent->emcCollection()->detector(ids[iplane]);
727  if ( !detector )
728  {
729  Warning("fillStEvent","detector == NULL for smd plane, no clusters for you");
730  }
731  else if ( mNumberOfClusters[4+iplane] > 0 )
732  {
733 
734  StEmcClusterCollection *smdc = detector -> cluster();
735  if ( !smdc )
736  {
737  //Warning("fillStEvent","StEmcClusterCollection (smd) was NULL, so I'm creating one.");
738  smdc = new StEmcClusterCollection();
739  detector->setCluster( smdc );
740  }
741 
742  smdc->setDetector( ids[iplane] );
743  smdc->setClusterFinderId( 123 );
744  smdc->setClusterFinderParamVersion( 321 );
745 
746 
747  for ( Int_t isector=0; isector<12; isector++ )
748  {
749 
750  for ( UInt_t iclust=0; iclust<mSmdClusters[isector][iplane].size(); iclust++ )
751  {
752 
753  StEEmcSmdCluster cl = (mSmdClusters[isector][iplane])[iclust];
754 
755 
756  StEmcCluster *emccluster = new StEmcCluster();
757  emccluster->setEta( cl.mean() );
758  emccluster->setPhi( (Float_t)iplane );
759  emccluster->setSigmaEta(-1.);
760  emccluster->setSigmaPhi(-1.);
761  emccluster->setEnergy( cl.energy() );
762  emccluster->SetUniqueID( cl.key() );
763  for ( Int_t i=0; i< cl.numberOfStrips(); i++ )
764  {
765  StEmcRawHit *hit=cl.strip(i).stemc();
766  assert( hit );
767  emccluster->addHit( hit );
768  }
769  smdc->addCluster( emccluster );
770 
771  mEtoEEsmd[ emccluster ] = cl;
772  cl.stemc( emccluster );
773 
774  }
775 
776 
777  }
778 
779  }
780 
781  else
782  {
783  detector -> setCluster( NULL );
784  }
785 
786 
787 
788  }
789 
790 
791 }
792 
793 
794 
795 // ----------------------------------------------------------------------------
797  {
798 
800  const StEvent *stevent=(const StEvent*)GetInputDS("StEvent");
801  if ( !stevent ) {
802  Warning("verifyStEvent","No StEvent found.");
803  return true;
804  }
805  //StEmcCollection *emccollection=stevent->emcCollection();
806 
807  Bool_t go = true;
808 
809  const StEmcDetector *detector=stevent->emcCollection()->detector(kEndcapEmcTowerId);
810  if ( !detector )
811  {
812  Warning("verifyStEvent","detector == NULL for towers");
813  return false;
814  }
815 
816 
817  const StEmcClusterCollection *cc=detector->cluster();
818  if ( cc )
819  {
820 
821 
826 
827  Float_t emc_sum_towers = 0.;
828  Float_t eemc_sum_towers = 0.;
829 
830  const StSPtrVecEmcCluster &emcClusters=cc->clusters();
831  for ( UInt_t i=0; i<emcClusters.size(); i++ )
832  {
833  const StEmcCluster *cl=emcClusters[i];
834  assert(cl);
835  emc_sum_towers += cl->energy();
836  }
837 
838  for ( Int_t sec=0; sec<12; sec++ )
839  {
840 
841  for ( Int_t i=0; i<numberOfClusters(sec,0); i++ )
842  eemc_sum_towers += cluster(sec,0,i).energy();
843  }
844 
845  std::cout << "StEEmcClusterMaker tower checksum: ";
846  if ( emc_sum_towers == eemc_sum_towers ) {
847  std::cout << "passed";
848  }
849  else {
850  std::cout << "FAILED"; go=false;
851  }
852  std::cout << std::endl;
853 
854  }
855  else {
856 
857  std::cout << "StEEmcClusterMaker tower checksum: NULL collection, nclust=" << mNumberOfClusters[0] << std::endl;
858  go &= (mNumberOfClusters[0]==0);
859 
860  }
861 
866  Float_t emc_sum_smdu = 0.;
867  Float_t eemc_sum_smdu = 0.;
868 
869  detector=stevent->emcCollection()->detector(kEndcapSmdUStripId);
870  if ( !detector )
871  {
872  Warning("verifyStEvent","detector == NULL for smdu");
873  return false;
874  }
875 
876  cc=detector->cluster();
877  if ( cc )
878  {
879 
880  const StSPtrVecEmcCluster &smduClusters=cc->clusters();
881 
882  for ( UInt_t i=0; i<smduClusters.size(); i++ )
883  {
884  const StEmcCluster *cl=smduClusters[i];
885  assert(cl);
886  emc_sum_smdu += cl->energy();
887  }
888 
889 
890  for ( Int_t sec=0; sec<12; sec++ )
891  {
892 
893  for ( Int_t i=0; i<numberOfSmdClusters(sec,0); i++ )
894 
895  {
896  eemc_sum_smdu += smdcluster(sec,0,i).energy();
897 
898  }
899 
900  }
901 
902  std::cout << "StEEmcClusterMaker smdu checksum: ";
903  if ( emc_sum_smdu == eemc_sum_smdu ) {
904  std::cout << "passed";
905  }
906  else {
907  std::cout << "FAILED"; go=false;
908  }
909  std::cout << std::endl;
910 
911  }
912  else
913  {
914  std::cout << "StEEmcClusterMaker smdu checksum: NULL collection, nclust=" << mNumberOfClusters[4] << std::endl;
915  go &= (mNumberOfClusters[4]==0);
916  }
917 
918 
920 
921  Float_t emc_sum_smdv = 0.;
922  Float_t eemc_sum_smdv = 0.;
923 
924  detector=stevent->emcCollection()->detector(kEndcapSmdVStripId);
925  if (!detector)
926  {
927  Warning("verifyStEvent","detector == NULL for smdv");
928  return false;
929  }
930 
931  cc=detector->cluster();
932 
933  if ( cc )
934  {
935 
936  const StSPtrVecEmcCluster &smdvClusters=cc->clusters();
937 
938  for ( UInt_t i=0; i<smdvClusters.size(); i++ )
939  {
940  const StEmcCluster *cl=smdvClusters[i];
941  assert(cl);
942  emc_sum_smdv += cl->energy();
943  }
944 
945 
946  for ( Int_t sec=0; sec<12; sec++ )
947  {
948 
949  for ( Int_t i=0; i<numberOfSmdClusters(sec,1); i++ )
950 
951  {
952  eemc_sum_smdv += smdcluster(sec,1,i).energy();
953 
954  }
955 
956  }
957 
958  std::cout << "StEEmcClusterMaker smdv checksum: ";
959  if ( emc_sum_smdv == eemc_sum_smdv ) {
960  std::cout << "passed";
961  }
962  else {
963  std::cout << "FAILED"; go=false;
964  }
965  std::cout << std::endl;
966 
967  }
968  else
969  {
970  std::cout << "StEEmcClusterMaker smdv checksum: NULL collection, nclust=" << mNumberOfClusters[5] << std::endl;
971  go &= (mNumberOfClusters[5]==0);
972  }
973 
974 
975 
976  return go;
977 }
978 
979 
980 
981 // ----------------------------------------------------------------------------
983 {
984 
985  std::cout << "StEEmcClusterMaker::print()" << std::endl;
986  const Char_t *names[] = { "tower", "pre1", "pre2", "post", "smdu", "smdv" };
987  for ( Int_t i=0;i<6;i++ )
988  {
989 
990  std::cout << "Number of " << names[i]
991  << " clusters = " << mNumberOfClusters[i]
992  << std::endl;
993 
994  }
995 
996  std::cout << "printout of tower clusters follows:" << std::endl;
997  for ( Int_t sec=0;sec<12;sec++)
998  for ( Int_t i=0;i<numberOfClusters(sec,0);i++ )
999  {
1000  const StEEmcCluster &clust=cluster(sec,0,i);
1001  clust.print();
1002  // std::cout << "cluster.key()=" << clust.key() << std::endl;
1003  // std::cout << "cluster.eta()=" << clust.momentum().Eta() << std::endl;
1004  // std::cout << "cluster.phi()=" << clust.momentum().Phi() << std::endl;
1005  // std::cout << "cluster.energy()=" << clust.energy() << std::endl;
1006  }
1007 
1008 
1009 
1010 }
TVector3 momentum() const
Definition: StEEmcCluster.h:69
const StEEmcA2EMaker * mEEanalysis
ADC–&gt;E maker.
TVector3 getTowerCenter(const UInt_t sec, const UInt_t sub, const UInt_t etabin) const
Int_t mSuppress
Supress seeds adjacent to clusters.
virtual void Clear(Option_t *opts="")
Clear clusters for next event.
StEEmcTower & tower(Int_t t)
Get the specified tower within the cluster.
Definition: StEEmcCluster.h:79
Int_t numberOfNeighbors() const
get the number of neighboring towers
Definition: StEEmcTower.h:54
EEmc ADC –&gt; energy maker.
StEEmcClusterMaker(const Char_t *name="mEEclusters")
Int_t numberOfClusters(Int_t sec, Int_t layer) const
Return number of clusters for a given sector, layer.
void add(const StEEmcTower &t, Float_t weight=1.0)
std::vector< std::vector< StEEmcSmdClusterVec_t > > mSmdClusters
Int_t mMinStrips
Minimum number of smd strips to form seed.
StEEmcCluster & cluster(Int_t sec, Int_t layer, Int_t index)
Return a specific cluster from a given sector, layer.
const EEmcSmdMap * mEEmap
const EEmcGeomSimple * mEEtow
Int_t numberOfSmdClusters(Int_t sec, Int_t plane) const
Return number of smd clusters for a given sector, plane.
const EEmcSmdGeom * mEEsmd
Int_t mNumberOfClusters[6]
Counts clusters for full eemc, 0=T, 1=P, 2=Q, 3=R, 4=U, 5=V.
void neighbor(StEEmcTower *n)
add a tower to list of neighbors
Definition: StEEmcTower.h:52
StEEmcStrip & strip(Int_t sector, Int_t plane, Int_t strip)
std::vector< std::vector< StEEmcClusterVec_t > > mTowerClusters
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
std::vector< std::vector< StEEmcTowerVec_t > > mSeedTowers
Float_t mSeedFloor
blah...
Bool_t mFillStEvent
Option to fill StEvent.
void name(const Char_t *n)
Set the name for this element.
Definition: StEEmcElement.h:27
Bool_t mLoose
Loose cuts option.
void print() const
Prints cluster data.
Int_t etabin() const
Returns the etabin of this tower, pre- or postshower element.
Definition: StEEmcTower.h:45
void fail(unsigned f)
Set a fail bit for this element.
Definition: StEEmcElement.h:25
virtual Int_t Make()
Definition: StMaker.cxx:898
TString mAnalysisName
ADC–&gt;E maker name.
Int_t subsector() const
Returns subsector of this tower, pre- or postshower element.
Definition: StEEmcTower.h:43
virtual Bool_t buildSmdClusters()
Constructs smd clusters.
virtual Bool_t buildTowerClusters()
Constructs tower clusters.
StEEmcStripVec_t & strips(Int_t sec, Int_t pln)
Returns a vector of hit strips, given the sector and plane.
void print() const
Print a summary of this tower.
Definition: StEEmcTower.cxx:58
void index(Int_t i)
Sets the index for this SMD strip, 0..287.
Definition: StEEmcStrip.cxx:32
Bool_t mSkip
Skip strips if failbit set.
void index(Int_t i)
Definition: StEEmcTower.cxx:76
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StEmcCluster * stemc()
virtual Int_t Init()
Initialize.
Float_t mSeedEnergy[6]
Seed energy for 0=T, 1=P, 2=Q, 3=R, 4=U, 5=V.
Int_t sector() const
Returns sector of this tower, pre- or postshower element.
Definition: StEEmcTower.h:41
Int_t mMaxExtent
Maximum distance from SMD seed strips.
Int_t key()
Return a unique key assigned by the cluster maker.
StEmcCluster * stemc()
Int_t numberOfTowers() const
Get the number of towers in cluster.
Definition: StEEmcCluster.h:76
Definition: Stypes.h:42
EEMC simple geometry.
Definition: Stypes.h:40
A base class for representing clusters of EEMC smd strips.
virtual Int_t Make()
Make clusters for this event.
Float_t energy() const
Get energy of this cluster.
Definition: StEEmcCluster.h:62
void print() const
Event summary.
std::map< const StEmcCluster *, StEEmcCluster > mEtoEE
Map StEEmcClusters to StEmcClusters.
Bool_t verifyStEvent() const
A base class for describing clusters of EEMC towers.
Definition: StEEmcCluster.h:50
std::map< const StEmcCluster *, StEEmcSmdCluster > mEtoEEsmd
... and for smd clusters
void seedEnergy(Float_t energy, Int_t layer=0)
void stemc(StEmcRawHit *h)
Sets pointer to the StEmcRawHit when processing an StEvent file.
Definition: StEEmcElement.h:43
StEEmcSmdCluster & smdcluster(Int_t sec, Int_t plane, Int_t index)
return a specific cluster from a given sector, plane
void fillStEvent()
Fills StEvent cluster collections if the option is selected.
void energy(Float_t e)
Set the energy (adc-ped+0.5)/gain for this element.
Definition: StEEmcElement.h:21
StEEmcStrip & strip(Int_t s)
Returns the specified smd strip w/in the cluster.
Base class for describing an endcap SMD strip.
Definition: StEEmcStrip.h:8
Int_t mClusterId
Keep track of clusters.
A cluster maker for the EEMC.