#include <AlgThruMuonList.h>
Inheritance diagram for AlgThruMuonList:

Public Member Functions | |
| AlgThruMuonList () | |
| virtual | ~AlgThruMuonList () |
| virtual void | Trace (const char *c) const |
| virtual void | RunAlg (AlgConfig &ac, CandHandle &ch, CandContext &cx) |
Private Member Functions | |
| Bool_t | IsMatch (const CandMSTClusterHandle &clh1, const CandMSTClusterHandle &clh2, Float_t diff) const |
| void | RunMatchMSTClusterAlg (Float_t diff, TObjArray *&toayUV) |
|
|
Definition at line 42 of file AlgThruMuonList.cxx. 00043 {
00044 //
00045 // Purpose: Default constructor.
00046 //
00047 // Arguments: n/a
00048 //
00049 // Return: n/a
00050 //
00051 }
|
|
|
Definition at line 55 of file AlgThruMuonList.cxx. 00056 {
00057 //
00058 // Purpose: Default destructor.
00059 //
00060 // Arguments: n/a
00061 //
00062 // Return: n/a
00063 //
00064 }
|
|
||||||||||||||||
|
Definition at line 68 of file AlgThruMuonList.cxx. References CandMSTClusterHandle::GetZmax(), and CandMSTClusterHandle::GetZmin(). Referenced by RunMatchMSTClusterAlg(). 00070 {
00071 //
00072 // Purpose: Check whether clusters match up.
00073 //
00074 // Arguments:
00075 // clh1 in Handle to CandMSTCluster to check for match.
00076 // clh2 in Handle to CandMSTCluster to check for match.
00077 // diff in Max separation between cluster ends.
00078 //
00079 // Return:
00080 // kTRUE if ends of a cluster are within specified distance of ends
00081 // of other cluster
00082 // kFALSE otherwise
00083 //
00084
00085 return ((TMath::Abs(clh1.GetZmin() - clh2.GetZmin()) < diff)
00086 && (TMath::Abs(clh1.GetZmax() - clh2.GetZmax()) < diff));
00087 }
|
|
||||||||||||||||
|
Implements AlgBase. Definition at line 91 of file AlgThruMuonList.cxx. References CandHandle::AddDaughterLink(), AlgFactory::GetAlgHandle(), CandContext::GetCandRecord(), CandContext::GetDataIn(), CandHandle::GetDaughterIterator(), Registry::GetDouble(), AlgFactory::GetInstance(), CandContext::GetMom(), CandHandle::GetNDaughters(), CandClusterHandle::GetPlaneView(), CandStripHandle::GetStripEndId(), PlexPlaneId::IsVetoShield(), CandThruMuon::MakeCandidate(), MSG, and RunMatchMSTClusterAlg(). 00093 {
00094 //
00095 // Purpose: Identify CandThruMuons by matching together CandMSTClusters
00096 // with opposite strip orientations.
00097 //
00098 // Argument:
00099 // ac in AlgConfig containing cluster matching parameters.
00100 // ch in Handle to the new CandThruMuonList to fill.
00101 // cx in CandContext containing the CandMSTClusterList from
00102 // which to identify muons.
00103 //
00104 // Return: n/a
00105 //
00106
00107 MSG("BubAlg", Msg::kVerbose)
00108 << "Starting AlgThruMuonList::RunAlg()" << endl;
00109
00110 // Check for CandMSTClusterListHandle input.
00111 assert(cx.GetDataIn());
00112 assert(cx.GetDataIn()->InheritsFrom("CandMSTClusterListHandle"));
00113 const CandMSTClusterListHandle *cllh =
00114 dynamic_cast<const CandMSTClusterListHandle *>(cx.GetDataIn());
00115
00116 // Separate clusters into U- and V-orientations.
00117 TObjArray *clhayU = new TObjArray();
00118 TObjArray *clhayV = new TObjArray();
00119 TObjArray *cosmiccounts = 0;
00120 TIter clhItr(cllh->GetDaughterIterator());
00121 while (CandMSTClusterHandle *clh =
00122 dynamic_cast<CandMSTClusterHandle *>(clhItr())) {
00123
00124 // First check for cluster with veto shield digits.
00125 TIter chhItr(clh->GetDaughterIterator());
00126 CandDigiPairHandle *chh =
00127 dynamic_cast<CandDigiPairHandle *>(chhItr());
00128 if (chh->GetStripEndId().IsVetoShield()) {
00129 if (!cosmiccounts) cosmiccounts = new TObjArray();
00130 while ( (chh = dynamic_cast<CandDigiPairHandle*>(chhItr())) ) {
00131 cosmiccounts->Add(chh);
00132 }
00133 continue;
00134 }
00135
00136 // Switch on plane orientation.
00137 switch (clh->GetPlaneView()) {
00138 case PlaneView::kU:
00139 if (clh->GetNDaughters() <= 1) continue;
00140 clhayU->Add(clh);
00141 break;
00142 case PlaneView::kV:
00143 if (clh->GetNDaughters() <= 1) continue;
00144 clhayV->Add(clh);
00145 break;
00146 case PlaneView::kA:
00147 case PlaneView::kB:
00148 if (!cosmiccounts) cosmiccounts = new TObjArray();
00149 cosmiccounts->Add(chh);
00150 while ( (chh = dynamic_cast<CandDigiPairHandle*>(chhItr())) ) {
00151 cosmiccounts->Add(chh);
00152 }
00153 /*
00154 {
00155 TIter chhItr(clh->GetDaughterIterator());
00156 while (CandDigiPairHandle *chh =
00157 dynamic_cast<CandDigiPairHandle *>(chhItr())) {
00158 cosmiccounts->Add(chh);
00159 }
00160 }
00161 */
00162 break;
00163 default:
00164 MSG("BubAlg", Msg::kWarning)
00165 << "Unrecognized plane orientation." << endl;
00166 }
00167 }
00168
00169 // Match clusters.
00170 TObjArray *clhayUV = new TObjArray(2);
00171 clhayUV->AddAt(clhayU, 0);
00172 clhayUV->AddAt(clhayV, 1);
00173 RunMatchMSTClusterAlg(ac.GetDouble("DiffMax"), clhayUV);
00174
00175 // General setup for creating new CandThruMuons.
00176 MSG("BubAlg", Msg::kVerbose)
00177 << "Get AlgThruMuon instance from AlgThruMuonFactory." << endl;
00178 AlgFactory &af = AlgFactory::GetInstance();
00179 AlgHandle ah = af.GetAlgHandle("AlgThruMuon", "default");
00180
00181 MSG("BubAlg", Msg::kVerbose)
00182 << "Create CandContext instance." << endl;
00183 CandContext cxx(this, cx.GetMom());
00184
00185 MSG("BubAlg", Msg::kVerbose)
00186 << "cxx.SetCandRecord(cx.GetCandRecord());" << endl;
00187 cxx.SetCandRecord(cx.GetCandRecord());
00188
00189 // Iterate over matched pairs to create CandThruMuons.
00190 TIter mpairItr(clhayUV);
00191 while (TObjArray *mpair = dynamic_cast<TObjArray *>(mpairItr())) {
00192 if (cosmiccounts) mpair->AddAt(cosmiccounts, 2);
00193 cxx.SetDataIn(mpair);
00194 CandThruMuonHandle cmh = CandThruMuon::MakeCandidate(ah, cxx);
00195 ch.AddDaughterLink(cmh);
00196 }
00197 clhayUV->Delete();
00198 delete clhayUV;
00199 delete cosmiccounts;
00200 }
|
|
||||||||||||
|
Definition at line 204 of file AlgThruMuonList.cxx. References IsMatch(), and MSG. Referenced by RunAlg(). 00206 {
00207 //
00208 // Purpose: Match clusters together whose ends are within a specified
00209 // distance in the axial direction. Each cluster may be
00210 // matched to only one other cluster to be a muon.
00211 //
00212 // Arguments:
00213 // diff in Maximum separation between cluster ends.
00214 // toayUV in/out Array with:
00215 // [0] array of U-clusters
00216 // [1] array of V-clusters
00217 // On return toayUV points to a new array of matched
00218 // cluster pairs saved as arrays, i.e., toayUV is an
00219 // array of arrays. The pairs will have a third slot
00220 // for possible cosmic counts.
00221 //
00222 // Return: n/a
00223 //
00224
00225 MSG("BubAlg", Msg::kVerbose)
00226 << "Starting AlgThruMuonList::RunMatchMSTClusterAlg()" << endl;
00227
00228 // Separate U- and V-cluster arrays.
00229 assert(toayUV->At(0)->InheritsFrom("TObjArray"));
00230 assert(toayUV->At(1)->InheritsFrom("TObjArray"));
00231 TObjArray *toayU = dynamic_cast<TObjArray *>(toayUV->At(0));
00232 TObjArray *toayV = dynamic_cast<TObjArray *>(toayUV->At(1));
00233
00234 // Declare array to store matches.
00235 TObjArray *matchUV = new TObjArray();
00236
00237 // Iterate over all cluster combinations.
00238 TIter clhUItr(toayU);
00239 while (CandMSTClusterHandle *clhU =
00240 dynamic_cast<CandMSTClusterHandle *>(clhUItr())) {
00241 TIter clhVItr(toayV);
00242 while (CandMSTClusterHandle *clhV =
00243 dynamic_cast<CandMSTClusterHandle *>(clhVItr())) {
00244
00245 // Check for match.
00246 if (IsMatch(*clhU, *clhV, diff)) {
00247
00248 // Check whether either cluster has already been matched.
00249 Bool_t isMatched = kFALSE;
00250 TObjArrayIter tobjItr(matchUV);
00251 while (TObjArray *mpair = (TObjArray*) tobjItr()) {
00252 CandMSTClusterHandle *mlhU =
00253 dynamic_cast<CandMSTClusterHandle *>(mpair->At(0));
00254 CandMSTClusterHandle *mlhV =
00255 dynamic_cast<CandMSTClusterHandle *>(mpair->At(1));
00256 if ((*clhU == *mlhU) || (*clhV == *mlhV)) {
00257
00258 // Remove previous pair from match array.
00259 delete matchUV->Remove(mpair);
00260 isMatched = kTRUE;
00261
00262 // Remove both pairs from original arrays to stop future searches.
00263 toayU->Remove(mlhU);
00264 toayV->Remove(mlhV);
00265 toayU->Remove(clhU);
00266 toayV->Remove(clhV);
00267 break;
00268 }
00269 }
00270
00271 // If no previous match, add new pair to match array.
00272 // Extra spot for cosmic counts.
00273 if (isMatched) break;
00274 else {
00275 TObjArray *mpair = new TObjArray(3);
00276 mpair->AddAt(clhU, 0);
00277 mpair->AddAt(clhV, 1);
00278 matchUV->Add(mpair);
00279 }
00280 } // End if IsMatch
00281 } // End while clhV
00282 } // End while clhU
00283
00284 // Clean-up.
00285 delete toayU;
00286 delete toayV;
00287 delete toayUV;
00288 toayUV = matchUV;
00289 }
|
|
|
Reimplemented from AlgBase. Definition at line 293 of file AlgThruMuonList.cxx. References MSG. 00294 {
00295 //
00296 // Purpose: Trace the AlgThruMuonList.
00297 //
00298 // Arguments:
00299 // c in String tag for the trace.
00300 //
00301 // Return: n/a
00302 //
00303
00304 MSG("BubCand", Msg::kDebug)
00305 << "**********Begin AlgThruMuonList::Trace(\"" << c << "\")" << endl
00306 << "**********End AlgThruMuonList::Trace(\"" << c << "\")" << endl;
00307 }
|
1.3.9.1