extern void get_guidance(double time, struct sensordata *sensorData_ptr, struct nav *navData_ptr, struct control *controlData_ptr){ controlData_ptr->phi_cmd = doublet(2, time, 4, 20*D2R) + \ doublet(10, time, 4, 20*D2R) + \ doublet(16, time, 4, 20*D2R); // Roll angle command; doublet at 2 sec, fault at 8, doublets at 10 and 16 controlData_ptr->theta_cmd = base_pitch_cmd; // Pitch angle command }
std::vector<Doublet> WLeptonic::Doublets(boca::Event const &event, std::function<boost::optional<Doublet>(Doublet &)> const &function) const { INFO0; // std::vector<Lepton> leptons = SortedByPt(event.Leptons()); auto leptons = Leptons(event); auto missing_et = event.MissingEt(); auto doublets = std::vector<Doublet> {}; for (auto const &lepton : leptons) { if (reconstruct_neutrino_) { auto reconstructed = ReconstructNeutrino(lepton, missing_et.Transverse()); for (auto &doublet : reconstructed) if (auto optional = function(doublet)) doublets.emplace_back(*optional); } else { Doublet doublet(lepton, {}); doublets.emplace_back(doublet); } } return doublets; }
Object * cons(Object * object) { if (object->getObjectType() == NIL) { Doublet doublet(new Nil, new Nil); Object * res = &doublet; return res; } if (object->getObjectType() != DOUBLET) { return new Nil; } Doublet * doubletInput = dynamic_cast<Doublet *>(object); if (doubletInput->getCdr()->getObjectType() == NIL) { Doublet doubletOutput(doubletInput->getCar(), new Nil); Object * res = &doubletOutput; return res; } Doublet doubletOutput(doubletInput->getCar(), doubletInput->getCdr()); Object * res = &doubletOutput; return res; }